@@ -22,11 +22,12 @@ jobs:
2222 fail-fast : false
2323 matrix :
2424 config :
25- - {os: windows-latest, r: 'release'}
26- - {os: macOS-latest, r: 'release'}
27- - {os: ubuntu-latest, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
28- - {os: ubuntu-latest, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
29- - {os: ubuntu-latest, r: 'devel', valgrind: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
25+ - {os: windows-latest, r: 'release', valgrind: false}
26+ - {os: macOS-latest, r: 'release', valgrind: false}
27+ - {os: ubuntu-latest, r: 'release', valgrind: false}
28+ - {os: ubuntu-latest, r: 'devel', valgrind: false}
29+ - {os: ubuntu-latest, r: 'devel', valgrind: true}
30+ - {os: macos-26, r: 'release', valgrind: false}
3031
3132 env :
3233 R_REMOTES_NO_ERRORS_FROM_WARNINGS : true
@@ -42,73 +43,23 @@ jobs:
4243
4344 - uses : r-lib/actions/setup-pandoc@v2
4445
45- - name : Query dependencies
46- run : |
47- install.packages('remotes')
48- saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
49- writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
50- shell : Rscript {0}
51-
52- - name : Restore R package cache
53- if : runner.os != 'Windows'
54- uses : actions/cache@v4
55- with :
56- path : ${{ env.R_LIBS_USER }}
57- key : ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
58- restore-keys : ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
59-
60- - name : Install system dependencies
61- if : runner.os == 'Linux'
62- run : |
63- while read -r cmd
64- do
65- eval sudo $cmd
66- done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
67- - name : Install dependencies
68- run : |
69- remotes::install_deps(dependencies = TRUE)
70- remotes::install_cran("rcmdcheck")
71- shell : Rscript {0}
72-
73- - name : Check
74- if : ${{ matrix.config.valgrind != true }}
75- env :
76- _R_CHECK_CRAN_INCOMING_REMOTE_ : false
77- run : |
78- options(crayon.enabled = TRUE)
79- rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "error", check_dir = "check")
80- shell : Rscript {0}
46+ - uses : r-lib/actions/setup-r-dependencies@v2
8147
82- - name : Setup valgrind
83- if : ${{ matrix.config.valgrind == true }}
48+ - name : Install valgrind
49+ if : ${{ matrix.config.valgrind }}
8450 run : |
8551 sudo apt-get update
86- sudo apt-get install -y valgrind --no-install-recommends
87- shell : bash
52+ sudo apt-get install -y --no-install-recommends valgrind
8853
89- - name : Check with Valgrind
90- if : ${{ matrix.config.valgrind == true }}
91- env :
92- _R_CHECK_CRAN_INCOMING_REMOTE_ : false
93- run : |
94- options(crayon.enabled = TRUE)
95- rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran", "--use-valgrind"), error_on = "error", check_dir = "check")
96- shell : Rscript {0}
97-
98- - name : Upload check results
99- if : failure()
100- uses : actions/upload-artifact@main
54+ - uses : r-lib/actions/check-r-package@v2
55+ if : ${{ matrix.config.valgrind }}
10156 with :
102- name : ${{ runner.os }}-r${{ matrix.config.r }}-results
103- path : check
57+ args : ' c("--as-cran", "--use-valgrind")'
58+
59+ - uses : r-lib/actions/check-r-package@v2
60+ if : ${{ !matrix.config.valgrind }}
61+
62+
63+
10464
105- - name : Build the package
106- if : ${{ matrix.config.os == 'ubuntu-latest' && (matrix.config.r == 'release' || matrix.config.r == 'devel') && (matrix.config.valgrind != true) }}
107- run : R CMD build .
10865
109- - uses : actions/upload-artifact@v4
110- if : ${{ matrix.config.os == 'ubuntu-latest' && (matrix.config.r == 'release' || matrix.config.r == 'devel') && (matrix.config.valgrind != true) }}
111- with :
112- name : netdiffuseR-built-package-${{ matrix.config.os }}-${{ matrix.config.r }}
113- path : netdiffuseR_*.tar.gz
114- retention-days : 7
0 commit comments