-
Notifications
You must be signed in to change notification settings - Fork 7
50 lines (42 loc) · 1.7 KB
/
ci-example.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
name: CI Workflow Example
on:
pull_request:
push:
branches:
- master
jobs:
checks:
uses: ./.github/workflows/ci-workflow.yml
secrets:
nixbuild_token: ${{ secrets.nixbuild_token }}
with:
# All settings are optional, the CI Workflow has usable defaults
# The available settings are documented in ./ci-workflow.yml
# By default the CI Workflow uses flake.nix from the repository root, but
# we want it to use our example flake here
flake_directory: examples/using-the-ci-workflow
# Tweak the label shown for each job. This is done with a jq expression
# that produces a string based on the build's fields
label_builds: '"\(.attr).\(.system)"'
# We can filter which attributes to build by configuring a jq expression
# producing a boolean based on the build's fields. We use the same
# expression that the CI Workflow uses by default here (build everything
# in the flake's `checks` attribute).
filter_builds: '.top_attr == "checks"'
# If ignore_build_failures is set to true, the workflow will not be stopped
# on build errors, giving us the chance to process the build results in
# a dependant job. Defaults to false.
ignore_build_failures: true
# We create a job that depends on the the ci-workflow and verifies that the
# build results are what we expected.
results:
name: Verify results
runs-on: ubuntu-latest
needs: checks
steps:
- uses: actions/checkout@v4
- name: Verify build results
run: |
diff \
<(jq . ./examples/using-the-ci-workflow/expected-result.json) \
<(echo '${{ needs.checks.outputs.results }}' | jq .)