|
| 1 | +on: |
| 2 | + push: |
| 3 | + branches: |
| 4 | + - master |
| 5 | + pull_request: |
| 6 | + branches: |
| 7 | + - master |
| 8 | + |
| 9 | +name: R-check |
| 10 | + |
| 11 | +jobs: |
| 12 | + R-CMD-check: |
| 13 | + runs-on: ${{ matrix.config.os }} |
| 14 | + |
| 15 | + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) |
| 16 | + |
| 17 | + strategy: |
| 18 | + fail-fast: false |
| 19 | + matrix: |
| 20 | + config: |
| 21 | + - {os: macOS-latest, r: 'devel'} |
| 22 | + - {os: macOS-latest, r: 'release'} |
| 23 | + - {os: macOS-latest, r: 'oldrel'} |
| 24 | + - {os: windows-latest, r: 'devel'} |
| 25 | + - {os: windows-latest, r: 'release'} |
| 26 | + - {os: windows-latest, r: 'oldrel'} |
| 27 | + - {os: ubuntu-16.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} |
| 28 | + - {os: ubuntu-16.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} |
| 29 | + - {os: ubuntu-16.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} |
| 30 | + #- {os: ubuntu-16.04, r: '3.5', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} |
| 31 | + #- {os: ubuntu-16.04, r: '3.4', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} |
| 32 | + #- {os: ubuntu-16.04, r: '3.3', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} |
| 33 | + |
| 34 | + env: |
| 35 | + R_REMOTES_NO_ERRORS_FROM_WARNINGS: true |
| 36 | + RSPM: ${{ matrix.config.rspm }} |
| 37 | + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} |
| 38 | + |
| 39 | + steps: |
| 40 | + - uses: actions/checkout@v2 |
| 41 | + |
| 42 | + - uses: r-lib/actions/setup-r@master |
| 43 | + with: |
| 44 | + r-version: ${{ matrix.config.r }} |
| 45 | + |
| 46 | + - uses: r-lib/actions/setup-pandoc@master |
| 47 | + |
| 48 | + - name: Query dependencies |
| 49 | + run: | |
| 50 | + install.packages('remotes') |
| 51 | + saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) |
| 52 | + writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") |
| 53 | + shell: Rscript {0} |
| 54 | + |
| 55 | + - name: Cache R packages |
| 56 | + if: runner.os != 'Windows' |
| 57 | + uses: actions/cache@v1 |
| 58 | + with: |
| 59 | + path: ${{ env.R_LIBS_USER }} |
| 60 | + key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} |
| 61 | + restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- |
| 62 | + |
| 63 | + - name: Install system dependencies |
| 64 | + if: runner.os == 'Linux' |
| 65 | + env: |
| 66 | + RHUB_PLATFORM: linux-x86_64-ubuntu-gcc |
| 67 | + run: | |
| 68 | + Rscript -e "remotes::install_github('r-hub/sysreqs')" |
| 69 | + sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))") |
| 70 | + sudo -s eval "$sysreqs" |
| 71 | +
|
| 72 | + - name: Install dependencies |
| 73 | + run: | |
| 74 | + remotes::install_deps(dependencies = TRUE) |
| 75 | + remotes::install_cran("rcmdcheck") |
| 76 | + shell: Rscript {0} |
| 77 | + |
| 78 | + - name: Session info |
| 79 | + run: | |
| 80 | + options(width = 100) |
| 81 | + pkgs <- installed.packages()[, "Package"] |
| 82 | + sessioninfo::session_info(pkgs, include_base = TRUE) |
| 83 | + shell: Rscript {0} |
| 84 | + |
| 85 | + - name: Check |
| 86 | + env: |
| 87 | + _R_CHECK_CRAN_INCOMING_: false |
| 88 | + run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check") |
| 89 | + shell: Rscript {0} |
| 90 | + |
| 91 | + - name: Show testthat output |
| 92 | + if: always() |
| 93 | + run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true |
| 94 | + shell: bash |
| 95 | + |
| 96 | + - name: Upload check results |
| 97 | + if: failure() |
| 98 | + uses: actions/upload-artifact@master |
| 99 | + with: |
| 100 | + name: ${{ runner.os }}-r${{ matrix.config.r }}-results |
| 101 | + path: check |
0 commit comments