-
Notifications
You must be signed in to change notification settings - Fork 29
53 lines (45 loc) · 1.63 KB
/
build-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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Build, Test and Lint
on: [push, pull_request]
jobs:
build_and_test:
name: Build/test on ${{ matrix.os }}, Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.9"] # no 3.10 yet - see https://github.com/bbc/audio-offset-finder/issues/20
steps:
- uses: actions/checkout@v3
- name: Install FFMPEG (Windows-only)
if: ${{ matrix.os == 'windows-latest' }}
uses: FedericoCarboni/setup-ffmpeg@v1
id: setup-ffmpeg
- name: Install FFMPEG (Non-Windows)
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
brew install ffmpeg
elif [ "$RUNNER_OS" == "Linux" ]; then
sudo apt install -y ffmpeg
fi
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest
if [ -f requirements.txt ]; then echo "requirements.txt"; cat requirements.txt; pip install -r requirements.txt; fi
- name: Lint with black
uses: psf/black@stable
with:
version: "22.3.0"
- name: Test with pytest
run: |
pytest