Improvements and dependency fixes #38
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: CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: True | |
jobs: | |
test: | |
name: "Python ${{ matrix.python-version }} on ${{ matrix.os }}" | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 60 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-latest | |
python-version: "3.9" | |
channel-priority: "strict" | |
envfile: ".github/environment-ci.yml" | |
- os: ubuntu-latest | |
python-version: "3.10" | |
channel-priority: "strict" | |
envfile: ".github/environment-ci.yml" | |
- os: ubuntu-latest | |
python-version: "3.11" | |
channel-priority: "strict" | |
envfile: ".github/environment-ci.yml" | |
### NOTE: Coming soon when jams in mirdata is updated or removed | |
#- os: ubuntu-latest | |
# python-version: "3.12" | |
# channel-priority: "strict" | |
# envfile: ".github/environment-ci.yml" | |
#- os: ubuntu-latest | |
# python-version: "3.13" | |
# channel-priority: "strict" | |
# envfile: ".github/environment-ci.yml" | |
steps: | |
- uses: actions/checkout@v3 | |
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 wget libsndfile-dev libsox-fmt-mp3 ffmpeg zip | |
;; | |
macOS) | |
brew install libsamplerate wget libsndfile sox ffmpeg zip | |
;; | |
esac | |
- name: Cache conda | |
uses: actions/cache@v3 | |
env: | |
CACHE_NUMBER: 2 | |
with: | |
path: ~/conda_pkgs_dir | |
key: ${{ runner.os }}-${{ matrix.python-version }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles( matrix.envfile ) }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.python-version }}-conda-${{ env.CACHE_NUMBER }}- | |
${{ runner.os }}-${{ matrix.python-version }}-conda- | |
${{ runner.os }}-conda- | |
- name: Setup conda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
miniforge-variant: Miniforge3 | |
miniforge-version: latest | |
channel-priority: ${{ matrix.channel-priority }} | |
activate-environment: test | |
auto-update-conda: false | |
python-version: ${{ matrix.python-version }} | |
use-only-tar-bz2: false | |
- name: Install conda dependencies | |
run: mamba env update -n test -f ${{ matrix.envfile }} | |
if: steps.cache.outputs.cache-hit != 'true' | |
- name: Conda info | |
shell: bash -l {0} | |
run: | | |
conda info -a | |
conda list | |
- name: Run basic tests | |
shell: bash -l {0} | |
run: pytest tests/ | |
- name: Run tensorflow tests | |
shell: bash -l {0} | |
run: pytest tests/ --tensorflow | |
- name: Run torch tests | |
shell: bash -l {0} | |
run: pytest tests/ --torch | |
- name: Run full ML tests | |
shell: bash -l {0} | |
run: pytest tests/ --full_ml | |
- name: Run all tests | |
shell: bash -l {0} | |
run: pytest tests/ --all |