|
| 1 | +name: R-CMD-check |
| 2 | +on: push |
| 3 | +# CMD checks on win, mac, ubuntu |
| 4 | +jobs: |
| 5 | + R-CMD-check: |
| 6 | + runs-on: ${{ matrix.config.os }} |
| 7 | + name: R-CMD-check-${{ matrix.config.os }} (${{ matrix.config.r }}) |
| 8 | + |
| 9 | + strategy: |
| 10 | + fail-fast: false # dont cancel if one fails, might have differen checks fail on different OS |
| 11 | + matrix: |
| 12 | + config: |
| 13 | + - {os: macOS-latest, r: 'devel'} |
| 14 | + - {os: windows-latest, r: 'devel'} |
| 15 | + - {os: macOS-latest, r: 'release'} |
| 16 | + - {os: windows-latest, r: 'release'} |
| 17 | + - {os: ubuntu-16.04, r: 'release', rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"} |
| 18 | + env: |
| 19 | + R_REMOTES_NO_ERRORS_FROM_WARNINGS: true |
| 20 | + RSPM: ${{ matrix.config.rspm }} |
| 21 | + |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@v2 |
| 24 | + - uses: r-lib/actions/setup-r@master |
| 25 | + with: |
| 26 | + r-version: ${{ matrix.config.r }} |
| 27 | + - name: Query dependencies |
| 28 | + run: | |
| 29 | + install.packages('remotes') |
| 30 | + saveRDS(remotes::dev_package_deps(dependencies = TRUE), "depends.Rds", version = 2) |
| 31 | + shell: Rscript {0} |
| 32 | + |
| 33 | + - name: Cache R packages |
| 34 | + if: runner.os != 'Windows' |
| 35 | + uses: actions/cache@v1 |
| 36 | + with: |
| 37 | + path: ${{ env.R_LIBS_USER }} |
| 38 | + key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{ hashFiles('depends.Rds') }} |
| 39 | + restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}- |
| 40 | + |
| 41 | + - name: Install system dependencies |
| 42 | + if: runner.os == 'Linux' |
| 43 | + env: |
| 44 | + RHUB_PLATFORM: linux-x86_64-ubuntu-gcc |
| 45 | + run: | |
| 46 | + Rscript -e "remotes::install_github('r-hub/sysreqs')" |
| 47 | + sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))") |
| 48 | + sudo -s eval "$sysreqs" |
| 49 | + sudo apt-get install -y qpdf # qpdf needed on ubuntu |
| 50 | +
|
| 51 | + - name: Install tinytex for linux (to build vignettes) |
| 52 | + if: runner.os == 'Linux' |
| 53 | + run: | |
| 54 | + install.packages('tinytex') |
| 55 | + tinytex::install_tinytex() |
| 56 | + shell: Rscript {0} |
| 57 | + |
| 58 | + - name: Install gsl for mac |
| 59 | + if: runner.os == 'macOS' |
| 60 | + run: | |
| 61 | + brew install gsl |
| 62 | +
|
| 63 | + - name: Install package dependencies |
| 64 | + run: | |
| 65 | + remotes::install_deps(dependencies = TRUE) |
| 66 | + # remotes::install_cran(c("RcppGSL", "stringi"), repos = "https://cran.rstudio.com") |
| 67 | + remotes::install_cran("rcmdcheck", repos = "https://cran.rstudio.com") |
| 68 | + # remove because leads to NOTE. Does not exist on windows |
| 69 | + if(file.exists('depends.Rds')) {file.remove('depends.Rds')} |
| 70 | + shell: Rscript {0} |
| 71 | + |
| 72 | + - name: Check on Mac / ubuntu |
| 73 | + if: runner.os != 'Windows' |
| 74 | + run: rcmdcheck::rcmdcheck(args = c("--no-tests", "--as-cran", "--no-manual"), error_on = "warning", check_dir = "check") |
| 75 | + shell: Rscript {0} |
| 76 | + |
| 77 | + - name: Check on Windows, without install and vignette |
| 78 | + if: runner.os == 'Windows' |
| 79 | + run: rcmdcheck::rcmdcheck(args = c("--no-install", "--no-build-vignettes","--no-vignettes","--ignore-vignettes","--no-tests", "--as-cran", "--no-manual"), build_args = c("--no-build-vignettes"), error_on = "warning", check_dir = "check") |
| 80 | + shell: Rscript {0} |
0 commit comments