-
Notifications
You must be signed in to change notification settings - Fork 2
78 lines (68 loc) · 2.22 KB
/
ci.yaml
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
name: "Continuous Integration"
on:
pull_request:
merge_group:
push:
branches:
- "master"
concurrency:
group: ${{ github.repository }}-${{ github.workflow }}
cancel-in-progress: false
jobs:
nix-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v14
- uses: DeterminateSystems/magic-nix-cache-action@v8
- id: set-matrix
name: Generate Nix Matrix
run: |
set -euo pipefail
matrix="$(nix eval --json '.#githubActions.matrix')"
echo "matrix=${matrix}" >> "$GITHUB_OUTPUT"
nix-build:
needs: nix-matrix
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 10
matrix: ${{ fromJSON(needs.nix-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v14
- uses: DeterminateSystems/magic-nix-cache-action@v8
- run: nix build -L ".#${{ matrix.attr }}" --keep-going
- name: Twister Tests
uses: workflow/[email protected]
id: twister-tests
with:
flakes-from-devshell: true
script: |
west init -l .
west config --global update.narrow true
west update
./scripts/run-tests --clobber-output --inline-logs -v -N -M
- name: Merge Test Results
if: steps.twister-tests.conclusion == 'failure'
run: |
pip3 install junitparser junit2html
junitparser merge **/twister.xml junit.xml
junit2html junit.xml junit.html
- name: Upload Unit Test Results in HTML
if: steps.twister-tests.conclusion == 'failure'
uses: actions/upload-artifact@v4
with:
name: HTML Unit Test Results
if-no-files-found: ignore
path: |
junit.html
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: steps.twister-tests.conclusion == 'failure'
with:
check_name: Unit Test Results
github_token: ${{ secrets.GITHUB_TOKEN }}
files: "**/twister.xml"