Try pinning Ubuntu instead #300
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Test | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
- dev1 | |
- "!gh-pages" | |
env: | |
IS_CI: 'true' | |
jobs: | |
bundled: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: ['ubuntu-20.04'] | |
# Temporarily include 'patch' version due to issues/106 | |
# Can hopefully remove once locally run tests produce same values | |
# (i.e. when local platforms have caught up with CI) | |
python-version: ['3.9.16', '3.10.11', '3.11.3'] | |
jobtype: ['test'] | |
include: | |
- os: 'ubuntu-20.04' | |
python-version: '3.10.11' | |
jobtype: 'lint' | |
- os: 'ubuntu-20.04' | |
python-version: '3.10.11' | |
jobtype: 'coverage' | |
- os: 'ubuntu-20.04' | |
python-version: '3.10.11' | |
jobtype: 'test' | |
env: | |
JOBTYPE: ${{ matrix.jobtype }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
cache-dependency-path: 'setup.py' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -e .[dev] | |
pip install coveralls | |
- name: Run tests | |
run: | | |
if [[ "$JOBTYPE" == "lint" ]]; then | |
# Run flake8 via pre-commit instead. | |
#- flake8 . # Use --exit-zero to ignore failure | |
pre-commit install | |
pre-commit run --all-files | |
elif [[ "$JOBTYPE" == "coverage" ]]; then | |
pytest tests --ignore=dapper/mods/QG --cov=dapper --cov-report term-missing | |
else | |
pytest tests | |
fi | |
- name: Publish coverage to coveralls.io | |
if: ${{ env.JOBTYPE == 'coverage' }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: coveralls --service=github | |
conda: | |
defaults: | |
run: | |
shell: bash -el {0} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: ['ubuntu-latest'] | |
python-version: ['3.9', '3.10', '3.11'] | |
include: | |
- os: 'macos-latest' | |
python-version: '3.10' | |
- os: 'windows-latest' | |
python-version: '3.9' | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: pip install -e .[dev] | |
- name: Run tests | |
run: | | |
which python | |
pytest tests |