-
Notifications
You must be signed in to change notification settings - Fork 3
63 lines (52 loc) · 1.67 KB
/
test.yml
File metadata and controls
63 lines (52 loc) · 1.67 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Testing
on:
workflow_call:
inputs:
ref:
required: true
type: string
defaults:
run:
working-directory: ./
jobs:
app-testing:
runs-on: ubuntu-latest
name: Run Tests
steps:
- name: Harden runner
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ inputs.ref }}
- name: Setup uv
uses: astral-sh/setup-uv@v4
with:
python-version: "3.10"
- name: Install dependencies
run: uv sync --group dev --frozen
- name: Run Tests
run: uv run pytest --junitxml=build/reports/junit.xml
- name: Generate coverage report
uses: mridang/action-test-reporter@v1
if: always()
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
coverage-file: 'build/coverage/clover.xml'
- name: Upload Results
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: always()
with:
name: test-results
path: build/reports/junit.xml
- name: Generate Report
if: ${{ always() && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}
uses: dorny/test-reporter@6e6a65b7a0bd2c9197df7d0ae36ac5cee784230c # v2.0.0
with:
name: Tests
path: build/reports/junit.xml
reporter: java-junit
fail-on-error: 'false'
token: ${{ secrets.GITHUB_TOKEN }}