-
Notifications
You must be signed in to change notification settings - Fork 8
43 lines (40 loc) · 1.08 KB
/
test_code.yaml
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
name: Code test
on:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-20.04
timeout-minutes: 90
permissions:
pull-requests: write
steps:
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Checkout branch being tested
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
clean: false
- uses: actions/cache@v4
with:
path: |
~/.cache/pip
key: ${{ runner.os }}-${{ hashFiles('**/requirements*.txt') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-cov
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run test and build coverage file
run: |
pytest --cache-clear --cov=tdtax > pytest-coverage.txt
- name: Upload logs
uses: actions/upload-artifact@v4
if: ${{ !env.ACT }}
with:
name: logs
path: pytest-coverage.txt