Skip to content

Commit 1033336

Browse files
committed
ci: Run unit tests in CI
1 parent 342de4a commit 1033336

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: check-test-unit
2+
permissions:
3+
contents: read
4+
issues: read
5+
checks: write
6+
pull-requests: write
7+
8+
on:
9+
push:
10+
pull_request:
11+
workflow_dispatch:
12+
inputs:
13+
ref:
14+
description: "The ref (branch or SHA) to process"
15+
required: false
16+
type: string
17+
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
20+
cancel-in-progress: true
21+
22+
defaults:
23+
run:
24+
shell: bash -xe {0}
25+
26+
jobs:
27+
unit-test:
28+
runs-on: ubuntu-24.04
29+
steps:
30+
- uses: actions/checkout@v5
31+
with:
32+
ref: ${{ github.event.inputs.ref }} # Use the ref if provided, otherwise defaults to the current branch/commit
33+
34+
- uses: nixbuild/nix-quick-install-action@v33
35+
with:
36+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
37+
nix_conf: |
38+
extra-substituters = https://cache.garnix.io
39+
extra-trusted-public-keys = cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g
40+
- name: Populate the nix store
41+
run: |
42+
nix develop --command echo
43+
44+
- name: Run unit tests
45+
env:
46+
CI: true
47+
run: nix develop --command just test --profile ci-unit
48+
49+
- name: Publish Unit Test Results
50+
uses: EnricoMi/publish-unit-test-result-action@v2
51+
if: always()
52+
with:
53+
check_name: Test results
54+
files: |
55+
target/nextest/ci-unit/junit.xml

0 commit comments

Comments
 (0)