Skip to content

Mac/Linux tests

Mac/Linux tests #194

Workflow file for this run

name: Mac/Linux tests
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "0 11 * * 1" # Mondays @ 7AM Eastern
jobs:
tests:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
include:
- name: Python 3.9 with minimal dependencies and coverage
os: ubuntu-latest
python: 3.9
toxenv: py39-test-cov
- name: Python 3.10
os: ubuntu-latest
python: '3.10'
toxenv: py310-test
- name: Python 3.9 dev dependencies (allowed failure! check logs)
os: ubuntu-latest
python: 3.9
toxenv: py39-test-devdeps
toxposargs: --durations=50 || true # override exit code
# Mac:
- name: Python 3.9 standard tests (macOS)
os: macos-latest
python: 3.9
toxenv: py39-test
# Older Python versions:
- name: Python 3.8
os: ubuntu-latest
python: 3.8
toxenv: py38-test
- name: Python 3.7 with oldest supported version of all dependencies
os: ubuntu-latest
python: 3.7
toxenv: py37-test-oldestdeps
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
if: "!startsWith(matrix.os, 'windows')"
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
# Mac:
- name: Setup Mac - hdf5
if: startsWith(matrix.os, 'mac')
run: |
brew install hdf5
brew install c-blosc # See: https://github.com/PyTables/PyTables/issues/828
brew link c-blosc
# Any *nix:
- name: Install Python dependencies - nix
if: "!startsWith(matrix.os, 'windows')"
run: python -m pip install --upgrade tox
- name: Run tests - nix
if: "!startsWith(matrix.os, 'windows')"
run: tox ${{ matrix.toxargs }} -e ${{ matrix.toxenv }} -- ${{ matrix.toxposargs }}
- name: Check coverage.yml existence
if: "endsWith(matrix.name, 'coverage')"
id: check_files
uses: andstor/file-existence-action@v1
with:
files: "coverage.xml"
- name: Upload coverage report to codecov
uses: codecov/codecov-action@v1
if: steps.check_files.outputs.files_exists == 'true' && endsWith(matrix.name, 'coverage')
with:
file: ./coverage.xml # optional
- uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
path: ./result_images