-
-
Notifications
You must be signed in to change notification settings - Fork 16
48 lines (40 loc) · 1.07 KB
/
pytest.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: "PyTest & Codecov | Testing and Code Coverage"
on:
push:
branches: [dev]
pull_request:
types: [opened, reopened, edited, synchronize]
workflow_dispatch:
env:
default_branch: dev
jobs:
pytest:
name: pytest
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11.4"
- name: Install project dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ];
then pip install -r requirements.txt;
fi
- name: Run pytest
uses: pavelzw/pytest-action@v2
with:
custom-arguments: "--cov --cov-report=xml"
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}