-
Notifications
You must be signed in to change notification settings - Fork 5
66 lines (55 loc) · 1.96 KB
/
run_tests.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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Running tests
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
code-checks:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Ruff Linting
uses: chartboost/ruff-action@v1
with:
args: check leakpro --exclude examples,leakpro/tests
build:
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write # Ensure write permission for contents
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install micromamba
run: |
curl -L https://micromamba.snakepit.net/api/micromamba/linux-64/latest | tar -xvj -C /usr/local/bin/ --strip-components=1 bin/micromamba
- name: Install dependencies with micromamba
run: |
micromamba create --file environment.yml --name leakpro --root-prefix /home/runner/micromamba-root
- name: Set PYTHONPATH
run: echo "PYTHONPATH=$(pwd)" >> $GITHUB_ENV
- name: Install pytest and pytest-cov
shell: bash -l {0}
run: |
micromamba activate leakpro
micromamba install pytest pytest-cov
- name: Run tests with pytest
shell: bash -l {0}
run: |
micromamba activate leakpro
pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=leakpro leakpro/tests/ | tee pytest-coverage.txt
cat ./pytest-coverage.txt
- name: Upload test coverage report
uses: actions/upload-artifact@v4
with:
name: pytest-coverage.txt
path: pytest-coverage.txt