-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (83 loc) · 2.61 KB
/
test.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
87
88
89
90
91
92
93
94
95
96
97
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
---
name: 🧪 Test
on:
pull_request:
branches:
- main
types:
- opened
- synchronize
schedule:
- cron: "0 2 * * *"
workflow_dispatch:
concurrency:
group: ${{ format('{0}-{1}-{2}-{3}-{4}', github.workflow, github.event_name, github.ref, github.base_ref || null, github.head_ref || null) }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: write
checks: write
jobs:
test:
name: 🧪 Test
runs-on: ubuntu-latest
steps:
- name: ⤵️ Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 🚧 Setup Go
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
go-version-file: go.mod
cache: false
- name: 🚧 Setup Task
uses: arduino/setup-task@b91d5d2c96a56797b48ac1e0e89220bf64044611 # v2.0.0
with:
repo-token: ${{ github.token }}
- name: 🔨 Setup Test tools
run: task test:tools
- name: 🧪 Run fake tests
run: task test
- name: 📢 Publish test results
if: always()
uses: dorny/test-reporter@31a54ee7ebcacc03a09ea97a7e5465a47b84aea5 # v1.9.1
with:
name: 📜 Test results
reporter: jest-junit
path: testresults.xml
- name: ⚙️ Get Coverage summary
uses: irongut/CodeCoverageSummary@51cc3a756ddcd398d447c044c02cb6aa83fdae95 # v1.3.0
with:
filename: coverage.xml
badge: true
fail_below_min: false
format: markdown
hide_branch_rate: false
hide_complexity: false
indicators: true
output: both
thresholds: "40 60"
- name: 📢 Publish coverage results
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
- name: 📤 Upload test results
if: always()
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
with:
name: test-results
path: testresults.xml
if-no-files-found: warn
overwrite: true
- name: 📤 Upload coverage results
if: always()
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
with:
name: test-coverage-results
path: |
coverage.html
coverage.json
coverage.out
coverage.txt
coverage.xml
code-coverage-results.md
if-no-files-found: warn
overwrite: true