Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Use test matrix for mypy, pytest #279

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from
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
Loading