Comprehensive Test Suite #351
This file contains 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: Back-end Tests | |
on: | |
schedule: | |
- cron: "0 16 * * *" # Daily at noon EST | |
push: | |
branches: ["main"] | |
pull_request: | |
workflow_dispatch: | |
concurrency: # Cancel previous workflows on the same pull request | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
CACHE_NUMBER: 2 # increase to reset cache manually | |
permissions: | |
contents: write # Allow publishing releases from this workflow | |
jobs: | |
testing: | |
name: Back-end tests on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash -l {0} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- run: git fetch --prune --unshallow --tags | |
- name: Install Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install Conda Environment | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
activate-environment: commoners-test-app | |
environment-file: tests/demo/src/services/python/environment.yml | |
auto-activate-base: false | |
- name: Use Node.js 20 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install and build dependencies | |
run: corepack enable pnpm && pnpm install && pnpm build | |
- if: matrix.os == 'macos-latest' | |
name: Run tests for Mac | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: pnpm coverage | |
- if: matrix.os == 'windows-latest' | |
name: Run tests for Windows | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: pnpm coverage | |
- if: matrix.os == 'ubuntu-latest' | |
name: Run tests for Linux (xvfb) | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- pnpm coverage |