-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #99 from BCDA-APS/68-CI-workflows
combine CI workflows
- Loading branch information
Showing
6 changed files
with
91 additions
and
52 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
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 | ||
|
||
jobs: | ||
|
||
lint: | ||
name: Code style | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-python@v2 | ||
|
||
- name: Install Dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install flake8 | ||
- name: Run flake8 | ||
run: | | ||
flake8 | ||
# black | ||
test-matrix: | ||
name: Python ${{ matrix.python-version }} | ||
runs-on: ubuntu-latest | ||
needs: lint | ||
strategy: | ||
matrix: | ||
python-version: ['3.7', '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/provision-with-micromamba@main | ||
# use main branch to enable choice of channel-priority | ||
with: | ||
cache-env: true | ||
cache-env-key: env-key-${{ matrix.python-version }} | ||
channel-priority: flexible | ||
environment-file: environment.yml | ||
environment-name: anaconda-test-env-py-${{ matrix.python-version }} | ||
|
||
- name: Initial diagnostics | ||
run: | | ||
micromamba info | ||
micromamba list | ||
conda config --show-sources | ||
conda config --show | ||
micromamba env list | ||
printenv | sort | ||
- name: micromamba env & list | ||
run: | | ||
micromamba env list | ||
micromamba list | ||
- name: Run tests with pytest & coverage | ||
shell: bash -l {0} | ||
run: | | ||
python -m pip install pytest coverage coveralls | ||
coverage run --concurrency=thread --parallel-mode -m pytest -vvv . | ||
coverage combine | ||
coverage report --precision 3 | ||
- name: Upload to coveralls | ||
# https://github.com/TheKevJames/coveralls-python | ||
shell: bash -l {0} | ||
run: | | ||
coveralls --service=github | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
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
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
This file was deleted.
Oops, something went wrong.