-
Notifications
You must be signed in to change notification settings - Fork 73
83 lines (71 loc) · 2.53 KB
/
tests.yaml
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
#.github/workflows/tests.yaml
name: Unit Tests
on:
pull_request:
branches:
- main
- develop
push:
branches:
- '**' # Every branch
jobs:
tests:
if: github.repository_owner == 'paulovcmedeiros'
strategy:
fail-fast: true
matrix:
os: [ "ubuntu-latest" ]
env: [ "pytest" ]
python-version: [ "3.9" ]
name: "${{ matrix.os }}, python=${{ matrix.python-version }}"
runs-on: ${{ matrix.os }}
container:
image: python:${{ matrix.python-version }}-bullseye
env:
COVERAGE_FILE: ".coverage.${{ matrix.env }}.${{ matrix.python-version }}"
steps:
#----------------------------------------------
# check-out repo
#----------------------------------------------
- name: Check out repository
uses: actions/checkout@v3
#----------------------------------------------
# Install Audio Gear
#----------------------------------------------
- name: Install PortAudio and PulseAudio
run: |
apt-get update
apt-get --assume-yes install portaudio19-dev python-all-dev pulseaudio ffmpeg
#----------------------------------------------
# --- configure poetry & install project ----
#----------------------------------------------
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached venv (if cache exists)
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: ${{ github.job }}-venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml', '**/poetry.toml') }}
- name: Install dependencies (if venv cache is not found)
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root --only main,test
- name: Install the project itself
run: poetry install --no-interaction --only-root
#----------------------------------------------
# run test suite and report coverage
#----------------------------------------------
- name: Run tests
env:
SDL_VIDEODRIVER: "dummy"
SDL_AUDIODRIVER: "disk"
run: |
poetry run pytest
- name: Upload test coverage report to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./.coverage.xml