forked from project-oak/silveroak
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild.yaml
67 lines (60 loc) · 2.2 KB
/
cloudbuild.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
# Reference: https://cloud.google.com/cloud-build/docs/build-config
steps:
# GCB doesn't clone submodules and removes .git directory, so we fetch the
# current $COMMIT_SHA and clone the submodules manually.
- name: 'nixos/nix:2.3.4'
id: recover_git_folder
entrypoint: 'nix-shell'
args: ['-p', '[bash git coreutils]', '--run',
'[ ! -d ".git" ] && echo "Recreating .git folder" && git clone -v https://github.com/project-oak/silveroak.git --no-checkout oak-hardware-git && mv oak-hardware-git/.git . && git fetch -v origin $COMMIT_SHA && git checkout -f $COMMIT_SHA && git submodule update --init --recursive || true']
- name: 'nixos/nix:2.3.4'
id: cache_dependencies
waitFor: ['recover_git_folder']
timeout: 20m
entrypoint: 'nix-shell'
args: ['--arg', 'buildVerilator', 'false', '--run', 'echo "Done."']
volumes:
- name: nix-store
path: /nix/
- name: 'nixos/nix:2.3.4'
id: build_verilator
waitFor: ['cache_dependencies']
timeout: 20m
entrypoint: 'nix-shell'
args: ['--arg', 'buildVerilator', 'true', '--run', 'echo "Done."']
volumes:
- name: nix-store
path: /nix/
- name: 'nixos/nix:2.3.4'
id: build_third_party
waitFor: ['recover_git_folder', 'cache_dependencies']
timeout: 20m
entrypoint: 'nix-shell'
args: ['--arg', 'buildVerilator', 'false', '--run', 'make -j32 third_party']
volumes:
- name: nix-store
path: /nix/
- name: 'nixos/nix:2.3.4'
id: make_cava_coq
waitFor: ['recover_git_folder', 'cache_dependencies', 'build_third_party']
timeout: 20m
entrypoint: 'nix-shell'
args: ['--arg', 'buildVerilator', 'false', '--run', 'make -j32 -C cava coq']
volumes:
- name: nix-store
path: /nix/
- name: 'nixos/nix:2.3.4'
id: make_all
waitFor: ['recover_git_folder', 'cache_dependencies', 'build_verilator', 'build_third_party', 'make_cava_coq']
timeout: 20m
entrypoint: 'nix-shell'
args: ['--run', 'git init; make -j32']
volumes:
- name: nix-store
path: /nix/
timeout: 30m
options:
# See: https://cloud.google.com/compute/docs/machine-types
machineType: 'N1_HIGHCPU_32'
requestedVerifyOption: 'VERIFIED'
sourceProvenanceHash: ['SHA256']