Skip to content
Draft
34 changes: 22 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,27 @@ on:

jobs:
pytest:
# Containers must run in Linux based operating systems
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
continue-on-error: true
steps:
- uses: actions/checkout@v3

- name: Set up Python 3.8
- name: Set up Python ${{ matrix.python-version }}
id: setup_python
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: ${{ matrix.python-version }}

- name: Cache environment
uses: actions/cache@master
id: cache
with:
path: ${{ env.pythonLocation }}/lib/python3.8/site-packages/*
key: ${{ runner.os }}-packages_only-${{ hashFiles('pyproject.toml') }}
path: ${{ env.pythonLocation }}
key: ${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
Expand All @@ -36,22 +41,27 @@ jobs:
run: python -m pytest -vv

mypy:
# Containers must run in Linux based operating systems
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
continue-on-error: true
steps:
- uses: actions/checkout@v3

- name: Set up Python 3.8
- name: Set up Python ${{ matrix.python-version }}
id: setup_python
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: ${{ matrix.python-version }}

- name: Cache environment
uses: actions/cache@master
id: cache
with:
path: ${{ env.pythonLocation }}/lib/python3.8/site-packages/*
key: ${{ runner.os }}-packages_only-${{ hashFiles('pyproject.toml') }}
path: ${{ env.pythonLocation }}
key: ${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
Expand Down