|
| 1 | +on: [push, pull_request] |
| 2 | + |
| 3 | +name: R-CMD-check |
| 4 | + |
| 5 | +jobs: |
| 6 | + R-CMD-check: |
| 7 | + runs-on: ${{ matrix.config.os }} |
| 8 | + |
| 9 | + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) |
| 10 | + |
| 11 | + strategy: |
| 12 | + fail-fast: false |
| 13 | + matrix: |
| 14 | + config: |
| 15 | + - { os: windows-latest, r: '3.6'} |
| 16 | + - { os: windows-latest, r: 'devel'} |
| 17 | + - { os: ubuntu-16.04, r: '3.5', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"} |
| 18 | + - { os: ubuntu-16.04, r: '3.6', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"} |
| 19 | + env: |
| 20 | + R_REMOTES_NO_ERRORS_FROM_WARNINGS: true |
| 21 | + PIP_NO_WARN_SCRIPT_LOCATION: false |
| 22 | + |
| 23 | + steps: |
| 24 | + - uses: actions/checkout@v1 |
| 25 | + |
| 26 | + - uses: r-lib/actions/setup-r@master |
| 27 | + |
| 28 | + - uses: r-lib/actions/setup-pandoc@master |
| 29 | + |
| 30 | + - name: Cache R packages |
| 31 | + if: runner.os != 'Windows' |
| 32 | + uses: actions/cache@v1 |
| 33 | + with: |
| 34 | + path: ${{ env.R_LIBS_USER }} |
| 35 | + key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{ hashFiles('DESCRIPTION') }} |
| 36 | + |
| 37 | + - name: Install system dependencies |
| 38 | + if: runner.os == 'Linux' |
| 39 | + env: |
| 40 | + RHUB_PLATFORM: linux-x86_64-ubuntu-gcc |
| 41 | + run: | |
| 42 | + Rscript -e "install.packages('remotes')" -e "remotes::install_github('r-hub/sysreqs')" |
| 43 | + sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))") |
| 44 | + sudo -s eval "$sysreqs" |
| 45 | + - name: Install dependencies |
| 46 | + run: Rscript -e "install.packages('remotes')" -e "remotes::install_deps(dependencies = TRUE)" -e "remotes::install_cran('rcmdcheck')" |
| 47 | + |
| 48 | + - name: Install TensorFlow |
| 49 | + run: | |
| 50 | + Rscript -e "remotes::install_github('rstudio/reticulate') # TODO remove when reticulate 1.14 is on CRAN" |
| 51 | + Rscript -e "reticulate::install_miniconda()" |
| 52 | + Rscript -e "reticulate::conda_create('r-reticulate', packages = 'python==3.6.9')" |
| 53 | + Rscript -e "tensorflow::install_tensorflow(version='1.14.0')" |
| 54 | + - name: Check |
| 55 | + run: Rscript -e "rcmdcheck::rcmdcheck(args = '--no-manual', error_on = 'warning', check_dir = 'check')" |
| 56 | + |
| 57 | + - name: Upload check results |
| 58 | + if: failure() |
| 59 | + uses: actions/upload-artifact@master |
| 60 | + with: |
| 61 | + name: ${{ runner.os }}-r${{ matrix.config.r }}-results |
| 62 | + path: check |
0 commit comments