Skip to content

feat: Model signing unit tests on all runners #37

feat: Model signing unit tests on all runners

feat: Model signing unit tests on all runners #37

Workflow file for this run

name: Run unit tests
on:
pull_request:
branches: [main]
types: [opened, synchronize]
permissions: {}
defaults:
run:
# The default shell on Windows is `pwsh`. However, it doesn't expand
# asterisks. That's why we always use `bash`.
shell: bash
jobs:
model-signing-unit-tests:
name: Run unit tests for signing
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # Don't cancel other jobs if one fails
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
with:
python-version: 3.11
cache: pip
cache-dependency-path: |
model_signing/install/requirements.txt
model_signing/install/requirements.test.txt
- name: Install dependencies
run: |
set -euo pipefail
python -m venv venv
source venv/bin/activate
python -m pip install --require-hashes -r model_signing/install/requirements.txt
python -m pip install --require-hashes -r model_signing/install/requirements.test.txt
- name: Run unit tests
run: |
set -euo pipefail
source venv/bin/activate
# NOTE: option --full-trace may be useful for troubleshooting.
# TODO(#68): Remove the need to create this folder.
mkdir testdata
pytest -v .