expand to py310 & py311 #919
Workflow file for this run
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: Unit Tests | |
on: | |
# Triggers the workflow on push or pull request events but only for the main branch | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: # allow manual triggering | |
defaults: | |
run: | |
shell: bash -l {0} | |
jobs: | |
lint: | |
name: Code style | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install flake8 | |
- name: Run flake8 | |
run: | | |
flake8 | |
- name: Run black | |
uses: rickstaa/action-black@v1 | |
with: | |
black_args: ". --check" | |
build: | |
runs-on: ubuntu-latest | |
needs: lint | |
strategy: | |
matrix: | |
python-version: | |
- "3.8" | |
- "3.9" | |
- "3.10" | |
- "3.11" | |
max-parallel: 5 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Create Python ${{ matrix.python-version }} environment | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
cache-environment: true | |
cache-environment-key: env-key-${{ matrix.python-version }} | |
condarc: | | |
channel-priority: flexible | |
environment-file: environment.yml | |
environment-name: hklpy-test-py-${{ matrix.python-version }} | |
create-args: >- | |
coveralls | |
pytest | |
pytest-cov | |
python=${{ matrix.python-version }} | |
- name: conda environments | |
shell: bash -l {0} | |
run: | | |
conda env list | |
micromamba env list | |
python --version | |
- name: Install the hklpy package | |
shell: bash -l {0} | |
run: | | |
pip install -e . | |
- name: Diagnostics | |
shell: bash -l {0} | |
run: | | |
pwd | |
ls -lAFgh | |
conda list -r | |
conda list | |
micromamba list | |
- name: Test with coverage and pytest | |
shell: bash -l {0} | |
run: | | |
coverage run --concurrency=thread --parallel-mode -m pytest -vvv | |
coverage combine | |
coverage report |