| on: [push, pull_request] |
| |
| name: check-linux |
| |
| jobs: |
| R-CMD-check: |
| runs-on: ${{ matrix.config.os }} |
| |
| name: ${{ matrix.config.os }} (${{ matrix.config.r }}) |
| |
| strategy: |
| fail-fast: false |
| matrix: |
| config: |
| - { os: ubuntu-18.04, r: 'release', cran: "https://demo.rstudiopm.com/all/__linux__/bionic/latest", args: "--no-manual" } |
| |
| env: |
| R_REMOTES_NO_ERRORS_FROM_WARNINGS: true |
| CRAN: ${{ matrix.config.cran }} |
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} |
| |
| steps: |
| - uses: actions/checkout@v1 |
| |
| - uses: r-lib/actions/setup-r@master |
| with: |
| r-version: ${{ matrix.config.r }} |
| |
| - uses: r-lib/actions/setup-pandoc@master |
| |
| - uses: r-lib/actions/setup-tinytex@master |
| if: contains(matrix.config.args, 'no-manual') == false |
| |
| - name: Install system dependencies |
| if: runner.os == 'Linux' |
| run: | |
| sudo apt-get update -y |
| sudo apt-get install -y libglpk-dev libjq-dev libv8-dev libprotobuf-dev protobuf-compiler libudunits2-dev libgdal-dev |
| |
| - name: Cache R packages |
| uses: actions/cache@v1 |
| with: |
| path: ${{ env.R_LIBS_USER }} |
| key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{ hashFiles('DESCRIPTION') }} |
| |
| - name: Install dependencies |
| 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')" |
| |
| - name: Check |
| run: Rscript -e "rcmdcheck::rcmdcheck(args = c('${{ matrix.config.args }}', '--run-donttest'), error_on = 'warning', check_dir = 'check')" |
| |
| - name: Upload check results |
| if: failure() |
| uses: actions/upload-artifact@master |
| with: |
| name: ${{ runner.os }}-r${{ matrix.config.r }}-results |
| path: check |
| |
| - name: Test coverage |
| run: covr::codecov() |
| shell: Rscript {0} |