Marc Kupietz | 81565a6 | 2020-03-06 15:26:38 +0100 | [diff] [blame] | 1 | on: [push, pull_request] |
| 2 | |
| 3 | name: check-linux |
| 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: |
Marc Kupietz | 6dc6146 | 2021-08-27 17:17:42 +0200 | [diff] [blame^] | 15 | - { os: ubuntu-18.04, r: 'release', cran: "https://demo.rstudiopm.com/all/__linux__/bionic/latest", args: "--no-manual" } |
Marc Kupietz | 81565a6 | 2020-03-06 15:26:38 +0100 | [diff] [blame] | 16 | |
| 17 | env: |
| 18 | R_REMOTES_NO_ERRORS_FROM_WARNINGS: true |
| 19 | CRAN: ${{ matrix.config.cran }} |
Marc Kupietz | 6dc6146 | 2021-08-27 17:17:42 +0200 | [diff] [blame^] | 20 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} |
Marc Kupietz | 81565a6 | 2020-03-06 15:26:38 +0100 | [diff] [blame] | 21 | |
| 22 | steps: |
| 23 | - uses: actions/checkout@v1 |
| 24 | |
| 25 | - uses: r-lib/actions/setup-r@master |
| 26 | with: |
| 27 | r-version: ${{ matrix.config.r }} |
| 28 | |
| 29 | - uses: r-lib/actions/setup-pandoc@master |
| 30 | |
| 31 | - uses: r-lib/actions/setup-tinytex@master |
| 32 | if: contains(matrix.config.args, 'no-manual') == false |
| 33 | |
| 34 | - name: Install system dependencies |
| 35 | if: runner.os == 'Linux' |
| 36 | run: | |
| 37 | sudo apt-get update -y |
| 38 | sudo apt-get install -y libglpk-dev libjq-dev libv8-dev libprotobuf-dev protobuf-compiler libudunits2-dev libgdal-dev |
| 39 | |
| 40 | - name: Cache R packages |
| 41 | uses: actions/cache@v1 |
| 42 | with: |
| 43 | path: ${{ env.R_LIBS_USER }} |
| 44 | key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{ hashFiles('DESCRIPTION') }} |
| 45 | |
| 46 | - name: Install dependencies |
Marc Kupietz | 6dc6146 | 2021-08-27 17:17:42 +0200 | [diff] [blame^] | 47 | run: Rscript -e "install.packages('remotes')" -e "remotes::install_deps(dependencies = TRUE)" -e "remotes::install_cran('rcmdcheck')" -e "install.packages('igraph')" -e "install.packages('covr')" |
Marc Kupietz | 81565a6 | 2020-03-06 15:26:38 +0100 | [diff] [blame] | 48 | |
| 49 | - name: Check |
Marc Kupietz | a50828b | 2020-03-06 16:49:55 +0100 | [diff] [blame] | 50 | run: Rscript -e "rcmdcheck::rcmdcheck(args = c('${{ matrix.config.args }}', '--run-donttest'), error_on = 'warning', check_dir = 'check')" |
Marc Kupietz | 81565a6 | 2020-03-06 15:26:38 +0100 | [diff] [blame] | 51 | |
| 52 | - name: Upload check results |
| 53 | if: failure() |
| 54 | uses: actions/upload-artifact@master |
| 55 | with: |
| 56 | name: ${{ runner.os }}-r${{ matrix.config.r }}-results |
| 57 | path: check |
| 58 | |
| 59 | - name: Test coverage |
Marc Kupietz | 6dc6146 | 2021-08-27 17:17:42 +0200 | [diff] [blame^] | 60 | run: covr::codecov() |
| 61 | shell: Rscript {0} |