|
| 1 | +name: Unit Tests and Slow Running API Integration Tests for R and Python |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + |
| 6 | +jobs: |
| 7 | + testing: |
| 8 | + name: test-slow-api-combinations |
| 9 | + runs-on: ${{ matrix.os }} |
| 10 | + |
| 11 | + strategy: |
| 12 | + fail-fast: false |
| 13 | + matrix: |
| 14 | + os: [ubuntu-latest, windows-latest, macos-latest] |
| 15 | + |
| 16 | + steps: |
| 17 | + - name: Prevent conversion of line endings on Windows |
| 18 | + if: startsWith(matrix.os, 'windows') |
| 19 | + shell: pwsh |
| 20 | + run: git config --global core.autocrlf false |
| 21 | + |
| 22 | + - name: Checkout repository |
| 23 | + uses: actions/checkout@v4 |
| 24 | + with: |
| 25 | + submodules: 'recursive' |
| 26 | + |
| 27 | + - name: Setup Python 3.12 |
| 28 | + uses: actions/setup-python@v5 |
| 29 | + with: |
| 30 | + python-version: "3.12" |
| 31 | + cache: "pip" |
| 32 | + |
| 33 | + - name: Set up openmp (macos) |
| 34 | + # Set up openMP on MacOS since it doesn't ship with the apple clang compiler suite |
| 35 | + if: matrix.os == 'macos-latest' |
| 36 | + run: | |
| 37 | + brew install libomp |
| 38 | +
|
| 39 | + - name: Install Package with Relevant Dependencies |
| 40 | + run: | |
| 41 | + pip install --upgrade pip |
| 42 | + pip install -r requirements.txt |
| 43 | + pip install . |
| 44 | +
|
| 45 | + - name: Run Pytest with Slow Running API Tests Enabled |
| 46 | + run: | |
| 47 | + pytest --runslow test/python |
| 48 | + |
| 49 | + - name: Setup Pandoc for R |
| 50 | + uses: r-lib/actions/setup-pandoc@v2 |
| 51 | + |
| 52 | + - name: Setup R |
| 53 | + uses: r-lib/actions/setup-r@v2 |
| 54 | + with: |
| 55 | + use-public-rspm: true |
| 56 | + |
| 57 | + - name: Setup R Package Dependencies |
| 58 | + uses: r-lib/actions/setup-r-dependencies@v2 |
| 59 | + with: |
| 60 | + extra-packages: any::testthat, any::decor, any::rcmdcheck |
| 61 | + needs: check |
| 62 | + |
| 63 | + - name: Create a CRAN-ready version of the R package |
| 64 | + run: | |
| 65 | + Rscript cran-bootstrap.R 0 0 1 |
| 66 | + |
| 67 | + - name: Run CRAN Checks with Slow Running API Tests Enabled |
| 68 | + uses: r-lib/actions/check-r-package@v2 |
| 69 | + env: |
| 70 | + RUN_SLOW_TESTS: true |
| 71 | + with: |
| 72 | + working-directory: 'stochtree_cran' |
0 commit comments