From 9ffaa1e6eb70f6e8214f0448c90b8b6a31a9431f Mon Sep 17 00:00:00 2001 From: Vito Sansevero Date: Wed, 7 Oct 2026 18:33:47 -0700 Subject: [PATCH] ci: test on Linux, Windows and macOS with a coverage gate and lint job --- .github/workflows/test.yml | 53 +++++++++++++++++++++++++++++++------- 1 file changed, 43 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0c27c74a..9a2425a7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,9 +11,12 @@ on: jobs: test: - runs-on: ubuntu-latest + name: py${{ matrix.python-version }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: + os: [ubuntu-latest, windows-latest, macos-latest] python-version: ["3.10", "3.11", "3.12"] steps: @@ -23,14 +26,8 @@ jobs: uses: actions/setup-python@v7 with: python-version: ${{ matrix.python-version }} - - - name: Cache pip dependencies - uses: actions/cache@v6 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('requirements-dev.txt') }} - restore-keys: | - ${{ runner.os }}-pip-${{ matrix.python-version }}- + cache: pip + cache-dependency-path: requirements-dev.txt - name: Install dependencies run: | @@ -38,9 +35,45 @@ jobs: pip install -r requirements-dev.txt - name: Run tests - run: python -m unittest discover tests/ -v + run: python -m unittest discover -s tests -v + + coverage: + name: coverage gate (85%) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + + - uses: actions/setup-python@v7 + with: + python-version: "3.12" + cache: pip + cache-dependency-path: requirements-dev.txt + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements-dev.txt + + - name: Measure coverage + run: | + python -m coverage run -m unittest discover -s tests + python -m coverage combine + python -m coverage report --fail-under=85 + + lint: + name: black and flake8 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-python@v7 + with: + python-version: "3.12" + - run: pip install black flake8 + - run: black --check . + - run: flake8 . js-test: + name: frontend modules runs-on: ubuntu-latest steps: - uses: actions/checkout@v7