-
Notifications
You must be signed in to change notification settings - Fork 5
executable file
·50 lines (41 loc) · 1.21 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
name: Running tests
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
code-checks-and-tests:
runs-on: ubuntu-latest
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 dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Ruff Linting
run: |
pip install ruff
ruff check leakpro --exclude examples,leakpro/tests
- name: Install pytest and pytest-cov
run: |
pip install pytest pytest-cov pytest-mock coverage-badge
- name: Run tests with pytest
run: |
pytest --cov=leakpro --cov-report=term-missing:skip-covered --cov-report=xml --cov-report=html leakpro/tests/
cat ./coverage.xml
- name: Create Coverage Badge
run: |
mkdir -p badges
coverage-badge -o badges/coverage.svg -f
- name: Deploy Coverage Badge to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: badges