Skip to content

Fix jobs not running on all OS's #27

Fix jobs not running on all OS's

Fix jobs not running on all OS's #27

Workflow file for this run

name: Tests
on:
push:
branches: ['*']
pull_request:
jobs:
build-and-test:
name: Test on ${{ matrix.platform }}
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11']
platform: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set pip cache directory
id: pip-cache
run: |
if [[ $RUNNER_OS == 'Windows' ]]; then
echo "dir=C:\\Users\\runneradmin\\AppData\\Local\\pip\\Cache" >> $GITHUB_OUTPUT
else
echo "dir=~/.cache/pip" >> $GITHUB_OUTPUT
fi
- name: Cache pip dependencies
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
restore-keys: ${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[dev]
- name: Type check with mypy
run: mypy tofea
- name: Test with pytest
run: pytest --cov tofea
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}