|
| 1 | +on: |
| 2 | + push: |
| 3 | + branches: [main, master] |
| 4 | + pull_request: |
| 5 | + branches: [main, master] |
| 6 | + |
| 7 | +name: R-CMD-check |
| 8 | + |
| 9 | +jobs: |
| 10 | + R-CMD-check: |
| 11 | + runs-on: ${{ matrix.config.os }} |
| 12 | + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) |
| 13 | + |
| 14 | + strategy: |
| 15 | + fail-fast: false |
| 16 | + matrix: |
| 17 | + config: |
| 18 | + - {os: macos-latest, r: 'release'} |
| 19 | + - {os: ubuntu-latest, r: 'release'} |
| 20 | + |
| 21 | + env: |
| 22 | + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} |
| 23 | + R_KEEP_PKG_SOURCE: yes |
| 24 | + |
| 25 | + steps: |
| 26 | + - name: Checkout Repository |
| 27 | + uses: actions/checkout@v4 |
| 28 | + |
| 29 | + - name: Set up Rust |
| 30 | + uses: dtolnay/rust-toolchain@stable |
| 31 | + |
| 32 | + - name: Cache Rust Compilation |
| 33 | + uses: Swatinem/rust-cache@v2 |
| 34 | + with: |
| 35 | + # Update this path to point inside the subdirectory! |
| 36 | + workspaces: "microbiorust-r/src/rust -> target" |
| 37 | + |
| 38 | + - name: Set up R |
| 39 | + uses: r-lib/actions/setup-r@v2 |
| 40 | + with: |
| 41 | + r-version: ${{ matrix.config.r }} |
| 42 | + use-public-rspm: true |
| 43 | + |
| 44 | + - name: Install R Dependencies |
| 45 | + uses: r-lib/actions/setup-r-dependencies@v2 |
| 46 | + with: |
| 47 | + # Tell R where the DESCRIPTION file is |
| 48 | + working-directory: microbiorust-r |
| 49 | + extra-packages: any::rcmdcheck |
| 50 | + needs: check |
| 51 | + |
| 52 | + - name: Run R CMD Check |
| 53 | + uses: r-lib/actions/check-r-package@v2 |
| 54 | + with: |
| 55 | + # Tell the checker where the package is |
| 56 | + working-directory: microbiorust-r |
| 57 | + env: |
| 58 | + _R_CHECK_CRAN_INCOMING_: false |
0 commit comments