-
Notifications
You must be signed in to change notification settings - Fork 51
185 lines (153 loc) · 5.24 KB
/
build_macos.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
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
name: build-macos
on:
push:
branches: [ master ]
pull_request:
concurrency:
group: ${{
( github.ref == 'refs/heads/master' &&
format('{0}/{1}', github.run_id, github.run_attempt) )
||
format('{0}/{1}', github.workflow, github.ref) }}
cancel-in-progress: true
jobs:
handle-syncwith:
if: github.event_name == 'pull_request'
name: Call Reusable SyncWith Handler
uses: NilFoundation/ci-cd/.github/workflows/reusable-handle-syncwith.yml@v1
with:
ci-cd-ref: 'v1'
fetch-only: true
secrets: inherit
build-macos:
runs-on: [ macos-11 ]
needs:
- handle-syncwith
steps:
- name: Install homebrew
run: >
/bin/bash -c "$(curl -fsSL
https://raw.githubusercontent.com/Homebrew/install/master/install.sh
)"
- name: Run brew install
id: brew-install
run: |
brew install \
cmake \
ninja \
icu4c \
libiconv \
openssl \
curl \
bash
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Print toolchain information
run: |
git --version
cc --version
cmake --version
ninja --version
bash --version
python3 --version
which -a bash
echo PATH: $PATH
- name: Checkout sources
# We need full history, because during CMake config stage we are finding the nearest tag
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: false
- name: Checkout submodules
run: |
git submodule update --init --recursive --depth=1
- name: Checkout modules to specified refs
if: needs.handle-syncwith.outputs.prs-refs != ''
uses: NilFoundation/ci-cd/actions/[email protected]
with:
paths: |
${{ github.workspace }}/**
!${{ github.workspace }}
!${{ github.workspace }}/**/.git/**
refs: ${{ needs.handle-syncwith.outputs.prs-refs }}
- name: Enable ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}
- name: Configure CMake
env:
BOOST_ROOT: "/usr/local/opt/[email protected]"
LDFLAGS: "-L/usr/local/opt/icu4c/lib"
CPPFLAGS: "-I/usr/local/opt/icu4c/include"
run: |
cmake -G "Ninja" \
-B build \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=FALSE \
-DBUILD_TESTS=TRUE .
- name: Build zkllvm
run: |
cmake --build build -t assigner clang transpiler
- name: Build IR of the C++ examples
run: |
cmake --build build -t compile_cpp_examples
ls -al ./build/examples/cpp
- name: Build circuits(.crct) of the C++ examples
run: |
cmake --build build -t cpp_examples_generate_crct
ls -al ./build/examples/cpp
- name: Build assignment tables(.tbl) of the C++ examples
run: |
cmake --build build -t cpp_examples_generate_tbl_no_check
ls -al ./build/examples/cpp
- name: Run size estimation for C++ examples
run: |
cmake --build build -t cpp_examples_estimate_size
- name: Compile tests as cpp code
run: |
cmake --build build -t all_tests_compile_as_cpp_code
- name: Compile tests as circuits
run: |
cmake --build build -t all_tests_compile_as_circuits
- name: Run tests as cpp code (expected res calculation)
run: |
cmake --build build -t all_tests_run_expected_res_calculation
- name: Run tests as circuits (real res calculation)
run: |
cmake --build build -t all_tests_assign_circuits
- name: Compare expected and real test results
run: |
chmod +x ./tests/run_test_results_comparison.sh
bash ./tests/run_test_results_comparison.sh
- name: Run tests on faulty inputs
run: |
chmod +x ./tests/run_tests_faulty_input.sh
bash ./tests/run_tests_faulty_input.sh pallas
- name: Run assigner unit tests
run: |
cmake --build build -t check-crypto3-assigner
- name: Build proof for the circuit of the C++ examples
run: |
cmake --build build -t prove_cpp_examples
- name: Build rslang
run: |
cmake --build build -t rslang
- name: Build IR of the Rust examples
run: |
cmake --build build -t compile_rust_examples
ls -al ./build/examples/rust/target/assigner-unknown-unknown/release/examples
- name: Build circuits(.crct) of the Rust examples
run: |
cmake --build build -t rust_examples_generate_crct
ls -al ./build/examples/cpp
- name: Build assignment tables(.tbl) of the Rust examples
run: |
cmake --build build -t rust_examples_generate_tbl
ls -al ./build/examples/cpp
- name: Build proofs for the circuits of the Rust examples
run: |
cmake --build build -t prove_rust_examples