Skip to content

Upgrade macOS Runner Image to macos-13 #147

Upgrade macOS Runner Image to macos-13

Upgrade macOS Runner Image to macos-13 #147

Workflow file for this run

name: Test
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
test-backend:
env:
UV_CACHE_DIR: /tmp/.uv-cache
strategy:
fail-fast: false
matrix:
python-version:
- "3.12"
os:
- ubuntu-latest
- windows-latest
- macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up uv
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }}
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Set up uv
if: ${{ matrix.os == 'windows-latest' }}
run: irm https://astral.sh/uv/install.ps1 | iex
shell: powershell
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Restore uv cache
uses: actions/cache@v4
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }}
with:
path: /tmp/.uv-cache
key: uv-${{ runner.os }}-${{ hashFiles('back/uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-${{ hashFiles('back/uv.lock') }}
uv-${{ runner.os }}
- name: Restore uv cache
uses: actions/cache@v4
if: ${{ matrix.os == 'windows-latest' }}
with:
path: /tmp/.uv-cache
key: uv-${{ runner.os }}-${{ hashFiles('back\uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-${{ hashFiles('back\uv.lock') }}
uv-${{ runner.os }}
- name: Install the project dependencies
run: |
cd back
uv sync --all-extras --dev
- name: Lint
run: |
cd back
uv run ruff check src tests
- name: "Create cache key for documentation"
if: ${{ matrix.os == 'ubuntu-latest' }}
run: echo "$PWD/back/.venv/bin" >> $GITHUB_PATH
- name: Check types
uses: jakebailey/pyright-action@v2
with:
working-directory: back/
extra-args: src
- name: Run tests
run: |
cd back
uv run pytest --cov=src/whombat --cov-report=xml -n auto
- name: Upload coverage reports to Codecov
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: codecov/codecov-action@v4
env:
files: back/coverage.xml
fail_ci_if_error: true
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Minimize uv cache
run: uv cache prune --ci
test-frontend:
runs-on: "ubuntu-latest"
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 22
cache: "npm"
cache-dependency-path: |
front/package-lock.json
- name: Install frontend dependencies
run: |
cd front
npm ci
- name: Run tests
run: |
cd front
npm run test