-
Notifications
You must be signed in to change notification settings - Fork 11
106 lines (96 loc) · 2.86 KB
/
ci.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
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: CI
on:
push:
branches:
- main
workflow_dispatch:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
run-checks:
# To run all of the below checks locally, run `nix flake check -L`
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- name: build with GCC
check: packages-default
- name: build with Clang
check: packages-ggl-clang
- name: cross-build for arm32 Musl
check: packages-ggl-musl-pi
- name: clang-tidy
check: clang-tidy
- name: header includes
check: iwyu
- name: editorconfig
check: editorconfig
- name: spelling
check: spelling
- name: cmake-lint
check: cmake-lint
- name: shellcheck
check: shellcheck
name: Check ${{ matrix.name }}
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
filter: "tree:0"
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Check ${{ matrix.name }}
run:
nix build -L --log-lines 0 .#checks.x86_64-linux.${{ matrix.check }}
format-check:
timeout-minutes: 60
name: Check formatting
runs-on: ubuntu-latest
defaults:
run:
shell: nix develop -c bash -exo pipefail {0}
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
filter: "tree:0"
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Check formatting
id: formatting-check
run: nix build -L --log-lines 0 .#checks.x86_64-linux.formatting
- name: Generate / show patch
if: ${{ failure() && steps.formatting-check.outcome == 'failure' }}
run: |
nix fmt
git diff >> formatting.patch
git diff --color=always
- name: Upload patch
if: ${{ failure() && steps.formatting-check.outcome == 'failure' }}
uses: actions/upload-artifact@v3
with:
name: formatting_patch
path: formatting.patch
retention-days: 5
git-secrets:
timeout-minutes: 60
name: Check git-secrets
runs-on: ubuntu-latest
defaults:
run:
shell: nix develop -c bash -exo pipefail {0}
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
filter: "tree:0"
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Check git-secrets
run: |
git-secrets --register-aws
git-secrets --scan