-
Notifications
You must be signed in to change notification settings - Fork 5
58 lines (47 loc) · 1.48 KB
/
unit_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
# https://pytest-with-eric.com/integrations/pytest-github-actions/
# https://github.com/mamba-org/setup-micromamba
name: Run unit tests
on:
- push
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.10"
- "3.11"
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up mamba environment and dependencies
uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: latest
environment-file: environment.yml
create-args: pytest pytest-cov
init-shell: bash powershell
cache-environment: true
post-cleanup: all
- name: Install EGL mesa for opencv functionality
shell: micromamba-shell {0}
run: |
sudo apt-get update -y -qq
sudo apt-get install -y -qq libegl1-mesa libegl1-mesa-dev
- name: Check if EGL library exists
run: ldconfig -p | grep EGL
- name: Install pdemtools
shell: micromamba-shell {0}
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade setuptools
cd $GITHUB_WORKSPACE
pip install .
- name: Test with pytest
shell: micromamba-shell {0}
run: |
coverage run -m pytest -v -s
- name: Generate pytest coverage report
shell: micromamba-shell {0}
run: |
coverage report -m