-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (41 loc) · 1.2 KB
/
testing.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
name: Unit tests
on:
push:
paths:
- 'requirements.txt'
- '.github/workflows/testing.yml'
- 'src/**'
- 'tests/**'
-
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.10.12]
steps:
- uses: actions/checkout@v4
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libgl1-mesa-glx
version: 1.0
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
# cahce python using venv
- uses: actions/cache@v2
id: cache-pip
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
if: steps.cache-venv.outputs.cache-hit != 'true'
run: pip install -r requirements.txt
# set pythonpath without using set-env
- name: Set PYTHONPATH
run: echo "PYTHONPATH=${{ github.workspace }}/src" >> $GITHUB_ENV
- name: Run tests
run: python -m pytest tests