Skip to content

Commit 0dad873

Browse files
committed
chore(ci): set up CI tests
1 parent 44b0920 commit 0dad873

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

.github/workflows/test.yaml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
name: Test
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
branches:
10+
- main
11+
12+
permissions:
13+
pull-requests: write
14+
contents: read
15+
16+
jobs:
17+
tests:
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 5
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
lfs: true
27+
28+
- name: Fetch and checkout LFS objects
29+
run: |
30+
git lfs fetch --all
31+
git lfs checkout
32+
33+
- uses: jdx/mise-action@v3
34+
with:
35+
install: true
36+
37+
- name: Run pre-commit
38+
run: mise run pre-commit
39+
40+
- name: Format
41+
run: |
42+
mise run fmt
43+
git diff --exit-code || (echo "Code is not formatted, run 'mise run fmt' locally" && exit 1)
44+
45+
- name: Lint
46+
run: mise run lint
47+
48+
- name: Unit tests
49+
run: mise run test_unit
50+
51+
- name: End to end tests
52+
run: mise run test_e2e
53+
54+
- name: Create coverage artifact
55+
run: mise run coverage
56+
57+
- name: Generate code coverage report
58+
uses: irongut/[email protected]
59+
with:
60+
filename: coverage.xml
61+
badge: false
62+
fail_below_min: false
63+
format: markdown
64+
hide_branch_rate: false
65+
hide_complexity: true
66+
indicators: true
67+
output: both
68+
69+
- name: Add Coverage PR Comment
70+
uses: marocchino/sticky-pull-request-comment@v2
71+
if: github.event_name == 'pull_request'
72+
with:
73+
recreate: true
74+
path: code-coverage-results.md

0 commit comments

Comments
 (0)