|
4 | 4 | schedule:
|
5 | 5 | - cron: "0 4 * * *"
|
6 | 6 |
|
7 |
| -name: Check/Codecov/Render |
| 7 | +name: R-CMD-check |
8 | 8 |
|
9 | 9 | jobs:
|
10 | 10 | R-CMD-check:
|
11 | 11 | runs-on: ${{ matrix.config.os }}
|
12 | 12 |
|
13 |
| - name: R CMD Check (${{ matrix.config.os }} (${{ matrix.config.r }})) |
| 13 | + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) |
14 | 14 |
|
15 | 15 | strategy:
|
16 | 16 | fail-fast: false
|
17 | 17 | matrix:
|
18 | 18 | config:
|
19 |
| - - { os: macOS-latest, r: "release" } |
20 |
| - - { os: macOS-latest, r: "3.6" } |
21 |
| - - { os: macOS-latest, r: "devel" } |
| 19 | + - {os: windows-latest, r: 'release'} |
| 20 | + - {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} |
| 21 | + - {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} |
| 22 | + - {os: ubuntu-20.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} |
22 | 23 |
|
23 | 24 | env:
|
24 | 25 | R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
|
25 | 26 | RSPM: ${{ matrix.config.rspm }}
|
| 27 | + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} |
26 | 28 |
|
27 | 29 | steps:
|
28 | 30 | - uses: actions/checkout@v2
|
29 | 31 |
|
30 |
| - - uses: r-lib/actions/setup-r@master |
| 32 | + - uses: r-lib/actions/setup-r@v1 |
| 33 | + id: install-r |
31 | 34 | with:
|
32 | 35 | r-version: ${{ matrix.config.r }}
|
| 36 | + http-user-agent: ${{ matrix.config.http-user-agent }} |
33 | 37 |
|
34 |
| - - uses: r-lib/actions/setup-pandoc@master |
| 38 | + - uses: r-lib/actions/setup-pandoc@v1 |
35 | 39 |
|
36 |
| - - name: Query dependencies |
| 40 | + - name: Install pak and query dependencies |
37 | 41 | run: |
|
38 |
| - install.packages(c("remotes", "devtools")) |
39 |
| - saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) |
40 |
| - writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") |
| 42 | + install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/") |
| 43 | + saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds") |
41 | 44 | shell: Rscript {0}
|
42 | 45 |
|
43 |
| - - name: Cache R packages |
44 |
| - uses: actions/cache@v1 |
| 46 | + - name: Restore R package cache |
| 47 | + uses: actions/cache@v2 |
45 | 48 | with:
|
46 |
| - path: ${{ env.R_LIBS_USER }} |
47 |
| - key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} |
48 |
| - restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- |
| 49 | + path: | |
| 50 | + ${{ env.R_LIBS_USER }}/* |
| 51 | + !${{ env.R_LIBS_USER }}/pak |
| 52 | + key: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }} |
| 53 | + restore-keys: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1- |
| 54 | + |
| 55 | + - name: Install system dependencies |
| 56 | + if: runner.os == 'Linux' |
| 57 | + run: | |
| 58 | + pak::local_system_requirements(execute = TRUE) |
| 59 | + pak::pkg_system_requirements("rcmdcheck", execute = TRUE) |
| 60 | + shell: Rscript {0} |
49 | 61 |
|
50 | 62 | - name: Install dependencies
|
51 | 63 | run: |
|
52 |
| - remotes::install_deps(dependencies = TRUE) |
53 |
| - remotes::install_cran("rcmdcheck") |
| 64 | + pak::local_install_dev_deps(upgrade = TRUE) |
| 65 | + pak::pkg_install("rcmdcheck") |
| 66 | + shell: Rscript {0} |
| 67 | + |
| 68 | + - name: Session info |
| 69 | + run: | |
| 70 | + options(width = 100) |
| 71 | + pkgs <- installed.packages()[, "Package"] |
| 72 | + sessioninfo::session_info(pkgs, include_base = TRUE) |
54 | 73 | shell: Rscript {0}
|
55 | 74 |
|
56 | 75 | - name: Check
|
57 | 76 | env:
|
58 |
| - _R_CHECK_CRAN_INCOMING_REMOTE_: false |
59 |
| - run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check") |
| 77 | + _R_CHECK_CRAN_INCOMING_: false |
| 78 | + run: | |
| 79 | + options(crayon.enabled = TRUE) |
| 80 | + rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check") |
60 | 81 | shell: Rscript {0}
|
61 | 82 |
|
| 83 | + - name: Show testthat output |
| 84 | + if: always() |
| 85 | + run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true |
| 86 | + shell: bash |
| 87 | + |
62 | 88 | - name: Upload check results
|
63 | 89 | if: failure()
|
64 | 90 | uses: actions/upload-artifact@main
|
65 | 91 | with:
|
66 |
| - name: ${{ runner.os }}-r${{ matrix.config.r }}-results |
| 92 | + name: ${{ matrix.config.os }}-r${{ matrix.config.r }}-results |
67 | 93 | path: check
|
68 | 94 |
|
69 |
| - - name: Install covr |
70 |
| - if: ${{ github.event_name == 'pull_request' && runner.os == 'macOS' }} |
71 |
| - run: install.packages('covr') |
72 |
| - shell: Rscript {0} |
| 95 | + - name: Don't use tar from old Rtools to store the cache |
| 96 | + if: ${{ runner.os == 'Windows' && startsWith(steps.install-r.outputs.installed-r-version, '3.6' ) }} |
| 97 | + shell: bash |
| 98 | + run: echo "C:/Program Files/Git/usr/bin" >> $GITHUB_PATH |
73 | 99 |
|
74 | 100 | - name: Test coverage
|
75 |
| - if: ${{ github.event_name == 'pull_request' && runner.os == 'macOS' }} |
76 |
| - run: covr::codecov() |
77 |
| - shell: Rscript {0} |
78 |
| - |
79 |
| - - name: Render rmd |
80 |
| - if: ${{ github.event_name == 'pull_request' && runner.os == 'macOS' }} |
| 101 | + if: ${{ runner.os == 'Linux' && matrix.config.r == 'release'}} |
81 | 102 | run: |
|
82 |
| - devtools::install() |
83 |
| - rmarkdown::render('README.Rmd') |
| 103 | + install.packages('covr') |
| 104 | + covr::codecov() |
84 | 105 | shell: Rscript {0}
|
85 |
| - |
86 |
| - - name: Commit changes |
87 |
| - if: ${{ github.event_name == 'pull_request' && runner.os == 'macOS' }} |
88 |
| - uses: EndBug/add-and-commit@v7 |
89 |
| - with: |
90 |
| - author_name: github-actions |
91 |
| - author_email: 41898282+github-actions[bot]@users.noreply.github.com |
92 |
| - message: 'Update README.md' |
93 |
| - add: 'README.md' |
|
0 commit comments