-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (41 loc) · 1.55 KB
/
testing_coverage.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
name: pytest and coverage report
# Triggers the workflow on push for all branches and PR only for main
on:
push:
branches:
- '*'
pull_request:
branches:
- main
jobs:
pytest:
runs-on: ubuntu-latest
steps:
# Check out repo and set up Python
- name: Check out the repository
uses: actions/checkout@v4
with:
lfs: true
# see https://stackoverflow.com/questions/57612428/cloning-private-github-repository-within-organisation-in-actions and https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#generating-a-new-ssh-key
- name: checkout test data
run: |
eval `ssh-agent -s`
ssh-add - <<< '${{ secrets.TEST_DATA_ACCESS_KEY }}'
git submodule sync --recursive
git submodule update --init --recursive
# Use cached python and dependencies, install poetry
- name: "Setup Python, Poetry and Dependencies"
uses: packetcoders/action-setup-cache-python-poetry@main
with:
python-version: 3.8
poetry-version: 1.2.2
# Run pytest with coverage report, saving to xml
- name: Run tests on python 3.8
run: |
poetry run pytest --cov --cov-report xml:cobertura.xml --full-trace --show-capture=no -sv -n auto tests/
# Take report and upload to coveralls
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: ./cobertura.xml