-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
101 additions
and
0 deletions.
There are no files selected for viewing
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,101 @@ | ||
name: testing | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: True | ||
|
||
jobs: | ||
test: | ||
name: "Python ${{ matrix.python-version }} on ${{ matrix.os }}" | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- os: ubuntu-latest | ||
python-version: "3.7" | ||
channel-priority: "strict" | ||
envfile: ".github/environment-ci.yml" | ||
|
||
- os: ubuntu-latest | ||
python-version: "3.8" | ||
channel-priority: "strict" | ||
envfile: ".github/environment-ci.yml" | ||
|
||
- os: ubuntu-latest | ||
python-version: "3.9" | ||
channel-priority: "strict" | ||
envfile: ".github/environment-ci.yml" | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- name: Install OS dependencies | ||
shell: bash -l {0} | ||
run: | | ||
case "${{ runner.os }}" in | ||
Linux) | ||
sudo apt-get update -yy | ||
sudo apt-get install -yy libsamplerate0 | ||
;; | ||
macOS) | ||
brew install libsamplerate | ||
;; | ||
esac | ||
- name: Cache conda | ||
uses: actions/cache@v2 | ||
env: | ||
# Increase this value to reset cache if etc/example-environment.yml has not changed | ||
CACHE_NUMBER: 1 | ||
with: | ||
path: ~/conda_pkgs_dir | ||
key: ${{ runner.os }}-${{ matrix.python-version }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles( matrix.envfile ) }} | ||
|
||
- name: Install Conda environment | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
auto-update-conda: true | ||
python-version: ${{ matrix.python-version }} | ||
add-pip-as-python-dependency: true | ||
auto-activate-base: false | ||
activate-environment: test | ||
channel-priority: ${{ matrix.channel-priority }} | ||
environment-file: ${{ matrix.envfile }} | ||
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! | ||
|
||
- name: Conda info | ||
shell: bash -l {0} | ||
run: | | ||
conda info -a | ||
conda list | ||
- name: Install pumpp | ||
shell: bash -l {0} | ||
run: python -m pip install --upgrade-strategy only-if-needed -e .[tests] | ||
|
||
- name: Run pytest | ||
shell: bash -l {0} | ||
run: pytest | ||
|
||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ./coverage.xml | ||
directory: ./coverage/reports/ | ||
flags: unittests | ||
env_vars: OS,PYTHON | ||
name: codecov-umbrella | ||
fail_ci_if_error: true | ||
path_to_write_report: ./coverage/codecov_report.txt | ||
verbose: true |