-
Notifications
You must be signed in to change notification settings - Fork 2
86 lines (73 loc) · 2.44 KB
/
skip-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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
---
# We check that using all --skip options does not error.
name: Skip tests
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
# * is a special character in YAML so you have to quote this string
# Run at 1:00 every day
- cron: 0 1 * * *
workflow_dispatch: {}
jobs:
build:
strategy:
matrix:
python-version: ['3.12']
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
with:
# See https://github.com/codecov/codecov-action/issues/190.
fetch-depth: 2
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Set secrets file
run: |
cp ./vuforia_secrets.env.example ./vuforia_secrets.env
- name: Run tests
run: |
uv run --extra=dev pytest \
--skip-docker_build_tests \
--skip-docker_in_memory \
--skip-mock \
--skip-real \
--capture=no \
-vvv \
--exitfirst \
--cov=src/ \
--cov=tests/ \
--cov-report=xml \
.
env:
UV_PYTHON: ${{ matrix.python-version }}
- name: Show coverage file
run: |
# Sometimes we have been sure that we have 100% coverage, but codecov
# says otherwise.
#
# We show the coverage file here to help with debugging.
# https://github.com/VWS-Python/vws-python-mock/issues/708
cat ./coverage.xml
# We run this job on every PR, on every merge to main, and nightly.
# This causes us to hit an issue with Codecov.
#
# We see "Too many uploads to this commit.".
# See https://community.codecov.io/t/too-many-uploads-to-this-commit/2574.
#
# To work around this, we do not upload coverage data on scheduled runs.
# We print the event name here to help with debugging.
- name: Show event name
run: |
echo ${{ github.event_name }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
# See https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954
# which tells us to use the token to avoid errors.
token: ${{ secrets.CODECOV_TOKEN }}
if: ${{ github.event_name == 'pull_request' || github.event_name == 'push' }}