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