CI Tests #607
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI Tests | |
| on: | |
| push: | |
| pull_request: | |
| schedule: | |
| # Run every Monday at midnight | |
| - cron: "0 0 * * 1" | |
| workflow_dispatch: | |
| # automatically cancel in-progress builds if another commit is pushed | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| # default to read-only permissions | |
| # (job-level overrides add the minimal permissions needed) | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| name: lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: check out repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 1 | |
| persist-credentials: false | |
| - uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd #v3.0.1 | |
| test: | |
| name: ${{ matrix.os }} (R ${{ matrix.r-version }}) | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 60 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| r-version: 'release' | |
| - os: macos-latest | |
| r-version: 'release' | |
| steps: | |
| - name: checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 1 | |
| persist-credentials: false | |
| - name: If local, apt update | |
| if: ${{ (env.ACT || false) && (matrix.os == 'ubuntu-latest')}} | |
| run: sudo apt update | |
| - name: Install Tidy Ubuntu | |
| if: matrix.os == 'ubuntu-latest' | |
| run: sudo apt install -y tidy | |
| - name: set up R | |
| uses: r-lib/actions/setup-r@6f6e5bc62fba3a704f74e7ad7ef7676c5c6a2590 # v2.11.4 | |
| with: | |
| r-version: ${{ matrix.r-version }} | |
| - uses: r-lib/actions/setup-pandoc@6f6e5bc62fba3a704f74e7ad7ef7676c5c6a2590 # v2.11.4 | |
| - uses: r-lib/actions/setup-tinytex@6f6e5bc62fba3a704f74e7ad7ef7676c5c6a2590 # v2.11.4 | |
| - uses: r-lib/actions/setup-r-dependencies@6f6e5bc62fba3a704f74e7ad7ef7676c5c6a2590 # v2.11.4 | |
| with: | |
| extra-packages: any::rcmdcheck, any::covr | |
| needs: check | |
| - uses: r-lib/actions/check-r-package@6f6e5bc62fba3a704f74e7ad7ef7676c5c6a2590 # v2.11.4 | |
| with: | |
| args: 'c("--as-cran")' | |
| error-on: '"warning"' | |
| check-dir: '"check"' | |
| upload-results: '"true"' | |
| upload-snapshots: '"true"' | |
| # https://github.community/t/is-it-possible-to-require-all-github-actions-tasks-to-pass-without-enumerating-them/117957/4?u=graingert | |
| all-successful: | |
| if: always() | |
| runs-on: ubuntu-latest | |
| needs: | |
| - lint | |
| - test | |
| permissions: | |
| statuses: read | |
| steps: | |
| - name: Note that all tests succeeded | |
| uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2 | |
| with: | |
| jobs: ${{ toJSON(needs) }} |