-
Notifications
You must be signed in to change notification settings - Fork 2
86 lines (69 loc) · 2.21 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
# Make sure .bashrc is read by shell for micromamba,
# see https://github.com/mamba-org/setup-micromamba#about-login-shells
defaults:
run:
shell: bash -l {0}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macOS-latest, windows-latest ]
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
sox: [ sox, no-sox ] # sox binary present or not
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }} with Micromamba
uses: mamba-org/setup-micromamba@v1
with:
cache-environment: true
environment-name: venv
create-args: >-
pip
python=${{ matrix.python-version }}
- name: Activate Python virtual environment
run: micromamba activate venv
- name: Install sox with Micromamba
run: micromamba install sox
if: matrix.sox == 'sox'
- name: Ubuntu - install libsndfile
run: |
sudo apt-get update
sudo apt-get install -y libsndfile1
if: matrix.os == 'ubuntu-latest' && matrix.sox == 'no-sox'
- name: Ubuntu - install ffmpeg/mediainfo
run: |
sudo apt-get update
sudo apt-get install -y ffmpeg mediainfo
if: matrix.os == 'ubuntu-latest'
- name: OSX - install ffmpeg/mediainfo
run: |
brew install ffmpeg
brew install media-info
if: matrix.os == 'macOS-latest'
- name: Windows - install ffmpeg/mediainfo
run: choco install ffmpeg mediainfo-cli
if: matrix.os == 'windows-latest'
- name: Install package
run: |
pip install -r requirements.txt
# TESTS
- name: Install test requirements
run: pip install -r tests/requirements.txt
- name: Show sox version
run: |
if $(which sox >/dev/null); then sox --version; else echo "No sox installed"; fi
- name: Test with pytest
run: python -m pytest
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
if: matrix.os == 'ubuntu-latest'