Skip to content

Back-end Tests

Back-end Tests #305

Workflow file for this run

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
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: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install pnpm
run: npm install -g pnpm
- name: Install Commoners
run: pnpm install
- name: Build Commoners
run: pnpm build
- if: matrix.os != 'ubuntu-latest'
name: Run tests
run: pnpm coverage
- if: matrix.os == 'ubuntu-latest'
name: Run tests with xvfb
run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- pnpm coverage