-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Initial workflow based on Nix Flake
Signed-off-by: Otavio Salvador <[email protected]>
- Loading branch information
Showing
2 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
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@v12 | ||
- uses: DeterminateSystems/magic-nix-cache-action@v7 | ||
- 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@v12 | ||
- uses: DeterminateSystems/magic-nix-cache-action@v7 | ||
- 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" |