Skip to content

WIP: CI: Optimize test matrix #69

WIP: CI: Optimize test matrix

WIP: CI: Optimize test matrix #69

Workflow file for this run

name: Run tests
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-12
python-version: '2.7'
setup-python: false
# python-version:
# - '2.7'
# - '3.6'
# - '3.7'
# - '3.8'
# - '3.9'
# - '3.10'
# - '3.11'
# - '3.12'
# os:
# - ubuntu-latest
# - macos-latest
# - windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python via actions/setup-python
if: ${{ fromJSON(matrix.setup-python) || matrix.setup-python == '' }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Configure PATH to use preinstalled Python 2.7
if: ${{ startsWith(matrix.os, 'macos') && matrix.python-version == '2.7' }}
run: |
echo '/Library/Frameworks/Python.framework/Versions/2.7/bin' >> $GITHUB_PATH
- name: Print PATH
run: |
echo "PATH: $PATH"
- name: Assert Python version
run: |
python -c 'import sys
assert "%d.%d" % sys.version_info[:2] == "${{ matrix.python-version }}!", sys.version'
- name: Install test runner
run: |
pip install --upgrade pip wheel setuptools
pip install pytest-cov
- name: Run tests
run: |
pytest --cov -- test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3