-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (44 loc) · 1.59 KB
/
Copy pathtests.yml
File metadata and controls
44 lines (44 loc) · 1.59 KB
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
name: Run tests
on:
pull_request:
push:
branches:
- main
jobs:
tests:
runs-on: ubuntu-latest
env:
# secrets cannot be referenced in step `if:` (schema); expose a boolean via env instead.
HAS_BOT_TOKEN: ${{ secrets.BOT_ACCESS_TOKEN != '' }}
permissions:
contents: write
pull-requests: write
steps:
- name: Check out code
uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "0.6.6"
- name: Install dependencies
run: uv sync
- name: Run tests with coverage
run: uv run pytest tests --verbose --cov=winnow --cov-report xml:coverage.xml --cov-report term-missing --junitxml=pytest.xml --cov-fail-under=0
- name: pytest coverage comment
id: coverageComment
uses: MishaKav/pytest-coverage-comment@287292879eaaff04116f36d3eb1a670f6e5df1a4
with:
pytest-xml-coverage-path: ./coverage.xml
junitxml-path: ./pytest.xml
# Dependabot (and some fork PRs) do not receive Actions secrets; skip gist update to avoid 401.
- name: Create the badge
if: env.HAS_BOT_TOKEN == 'true'
uses: schneegans/dynamic-badges-action@e9a478b16159b4d31420099ba146cdc50f134483
with:
auth: ${{ secrets.BOT_ACCESS_TOKEN }}
gistID: f6df3d7ac249eb608e631192d2efb25e
filename: pytest-coverage-comment.json
label: Test Coverage
message: ${{ steps.coverageComment.outputs.coverage }}
color: ${{ steps.coverageComment.outputs.color }}
namedLogo: python