This repository has been archived by the owner on Dec 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
233 lines (217 loc) · 7.21 KB
/
build_all.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
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
name: build_all
on:
push:
pull_request:
jobs:
# build the old version of the Cava core library
make_cava:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- uses: cachix/install-nix-action@v12
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Create a "lockfile" from git submodule commits
id: get-submodule-ver
run: |
git submodule status > ./third_party/submodules.lock
shell: bash
- name: Cache third_party
id: third_party-cache
uses: actions/cache@v2
with:
path: third_party
key: ${{ runner.os }}-third_party-${{ hashFiles('third_party/submodules.lock') }}
- name: Build third party
if: steps.third_party-cache.outputs.cache-hit != 'true'
run: nix-shell --run 'cd third_party; make -j1'
- name: Cache cava
id: cava-cache
uses: actions/cache@v2
with:
path: cava
key: ${{ runner.os }}-cava-${{ hashFiles('third_party/submodules.lock', 'cava/**/*.v', 'cava/Makefile' ) }}
- name: Build Cava
if: steps.cava-cache.outputs.cache-hit != 'true'
run: nix-shell --run 'cd cava; make -j1'
# build the new version of the Cava core library
make_cava2:
needs: make_cava
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- uses: cachix/install-nix-action@v12
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Create a "lockfile" from git submodule commits
id: get-submodule-ver
run: |
git submodule status > ./third_party/submodules.lock
shell: bash
- name: Cache third_party
id: third_party-cache
uses: actions/cache@v2
with:
path: third_party
key: ${{ runner.os }}-third_party-${{ hashFiles('third_party/submodules.lock') }}
- name: Cache cava
id: cava-cache
uses: actions/cache@v2
with:
path: cava
key: ${{ runner.os }}-cava-${{ hashFiles('third_party/submodules.lock', 'cava/**/*.v', 'cava/Makefile' ) }}
- name: Fail on cache miss
if: steps.third_party-cache.outputs.cache-hit != 'true' || steps.cava-cache.outputs.cache-hit != 'true'
run: exit 1
- run: nix-shell --run "cd cava2; make -j1"
- name: Cache cava2
id: cava2-cache
uses: actions/cache@v2
with:
path: cava2
key: ${{ runner.os }}-build-${{ github.run_id }}-cava2
# directories that depend only on cava/
make_directories_cava1:
strategy:
matrix:
build_dir: ["demos", "examples", "tests"
, "silveroak-opentitan/pinmux"
, "silveroak-opentitan/aes"
, "examples/xilinx"
, "tests/xilinx"
]
env:
BUILD_DIR: ${{ matrix.build_dir }}
needs: make_cava
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- uses: cachix/install-nix-action@v12
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Create a "lockfile" from git submodule commits
id: get-submodule-ver
run: |
git submodule status > ./third_party/submodules.lock
shell: bash
- name: Cache third_party
id: third_party-cache
uses: actions/cache@v2
with:
path: third_party
key: ${{ runner.os }}-third_party-${{ hashFiles('third_party/submodules.lock') }}
- name: Cache cava
id: cava-cache
uses: actions/cache@v2
with:
path: cava
key: ${{ runner.os }}-cava-${{ hashFiles('third_party/submodules.lock', 'cava/**/*.v', 'cava/Makefile' ) }}
- name: Fail on cache miss
if: steps.third_party-cache.outputs.cache-hit != 'true' || steps.cava-cache.outputs.cache-hit != 'true'
run: exit 1
- run: nix-shell --run "cd $BUILD_DIR; make -j1"
# firmware depends on cava (for Util) and cava2
make_firmware:
strategy:
matrix:
build_dir: ["firmware"]
env:
BUILD_DIR: ${{ matrix.build_dir }}
needs: [make_cava, make_cava2]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- uses: cachix/install-nix-action@v12
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Create a "lockfile" from git submodule commits
id: get-submodule-ver
run: |
git submodule status > ./third_party/submodules.lock
shell: bash
- name: Cache third_party
id: third_party-cache
uses: actions/cache@v2
with:
path: third_party
key: ${{ runner.os }}-third_party-${{ hashFiles('third_party/submodules.lock') }}
- name: Cache cava
id: cava-cache
uses: actions/cache@v2
with:
path: cava
key: ${{ runner.os }}-cava-${{ hashFiles('third_party/submodules.lock', 'cava/**/*.v', 'cava/Makefile' ) }}
- name: Use cava2 cache
id: cava2-cache
uses: actions/cache@v2
with:
path: cava2
key: ${{ runner.os }}-build-${{ github.run_id }}-cava2
- name: Fail on cache miss
if: steps.third_party-cache.outputs.cache-hit != 'true' || steps.cava-cache.outputs.cache-hit != 'true' || steps.cava2-cache.outputs.cache-hit != 'true'
run: exit 1
- run: nix-shell --run "cd $BUILD_DIR; make -j1"
- name: Cache firmware
id: firmware-cache
uses: actions/cache@v2
with:
path: firmware
key: ${{ runner.os }}-build-${{ github.run_id }}-firmware
# silveroak-opentitan/hmac depends on firmware, cava (for Util), and cava2
make_silveroak_hmac:
strategy:
matrix:
build_dir: ["silveroak-opentitan/hmac"]
env:
BUILD_DIR: ${{ matrix.build_dir }}
timeout-minutes: 80
needs: [make_cava, make_cava2, make_firmware]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- uses: cachix/install-nix-action@v12
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Create a "lockfile" from git submodule commits
id: get-submodule-ver
run: |
git submodule status > ./third_party/submodules.lock
shell: bash
- name: Cache third_party
id: third_party-cache
uses: actions/cache@v2
with:
path: third_party
key: ${{ runner.os }}-third_party-${{ hashFiles('third_party/submodules.lock') }}
- name: Cache cava
id: cava-cache
uses: actions/cache@v2
with:
path: cava
key: ${{ runner.os }}-cava-${{ hashFiles('third_party/submodules.lock', 'cava/**/*.v', 'cava/Makefile' ) }}
- name: Use cava2 cache
uses: actions/cache@v2
id: cava2-cache
with:
path: cava2
key: ${{ runner.os }}-build-${{ github.run_id }}-cava2
- name: Use firmware cache
uses: actions/cache@v2
id: firmware-cache
with:
path: firmware
key: ${{ runner.os }}-build-${{ github.run_id }}-firmware
- name: Fail on cache miss
if: steps.third_party-cache.outputs.cache-hit != 'true' || steps.cava-cache.outputs.cache-hit != 'true' || steps.cava2-cache.outputs.cache-hit != 'true' || steps.firmware-cache.outputs.cache-hit != 'true'
run: exit 1
- run: nix-shell --run "cd $BUILD_DIR; make -j1"