@@ -13,16 +13,45 @@ permissions:
13
13
env :
14
14
REPO : ${{ github.event.pull_request.head.repo.full_name || github.repository }}
15
15
REF : ${{ github.head_ref || github.ref_name }}
16
+ MINIMUM_NOIR_VERSION : v0.16.0
16
17
17
18
jobs :
19
+ noir-version-list :
20
+ name : Query supported Noir versions
21
+ runs-on : ubuntu-latest
22
+ outputs :
23
+ noir_versions : ${{ steps.get_versions.outputs.versions }}
24
+
25
+ steps :
26
+ - name : Checkout sources
27
+ id : get_versions
28
+ run : |
29
+ # gh returns the Noir releases in reverse chronological order so we keep all releases published after the minimum supported version.
30
+ VERSIONS=$(gh release list -R noir-lang/noir --exclude-pre-releases --json tagName -q 'map(.tagName) | index(env.MINIMUM_NOIR_VERSION) as $index | if $index then .[0:$index+1] else [env.MINIMUM_NOIR_VERSION] end')
31
+ echo "versions=$VERSIONS"
32
+ echo "versions=$VERSIONS" >> $GITHUB_OUTPUT
33
+ env :
34
+ GH_TOKEN : ${{ github.token }}
35
+
36
+
18
37
install :
19
38
name : Noir ${{matrix.toolchain}} (CLI) on ${{matrix.os == 'ubuntu' && 'Linux' || matrix.os == 'macos' && 'macOS' || matrix.os == 'windows' && 'Windows' || '???'}}
39
+ needs : [noir-version-list]
20
40
runs-on : ${{matrix.os}}-latest
21
41
strategy :
22
42
fail-fast : false
23
43
matrix :
24
44
os : [ubuntu, macos]
25
- toolchain : [stable, nightly, 0.1.0, 0.1.1, 0.2.0, 0.3.0, 0.4.1]
45
+ toolchain : ${{ fromJson( needs.noir-version-list.outputs.noir_versions )}}
46
+ include :
47
+ - os : ubuntu
48
+ toolchain : nightly
49
+ - os : ubuntu
50
+ toolchain : stable
51
+ - os : macos
52
+ toolchain : nightly
53
+ - os : macos
54
+ toolchain : stable
26
55
timeout-minutes : 45
27
56
steps :
28
57
- name : Parse toolchain
@@ -50,17 +79,44 @@ jobs:
50
79
run : noirup ${{steps.parse.outputs.toolchain}}
51
80
- name : Check nargo installation
52
81
run : nargo --version
82
+ - name : Check noir-inspector installation
83
+ run : |
84
+ # Fetch the version from `nargo` as to also check the `stable` and `nightly` toolchains
85
+ VERSION=$(nargo --version | awk -F' = ' '/nargo version/ {print $2}')
86
+ MIN_VERSION="1.0.0-beta.3"
87
+
88
+ version_gte() {
89
+ [ "$(printf '%s\n' "$1" "$2" | sort -V | head -n1)" = "$2" ]
90
+ }
91
+
92
+ if version_gte "$VERSION" "$MIN_VERSION"; then
93
+ noir-inspector --version
94
+ fi
95
+ - name : Check noir-profiler installation
96
+ run : |
97
+ # Fetch the version from `nargo` as to also check the `stable` and `nightly` toolchains
98
+ VERSION=$(nargo --version | awk -F' = ' '/nargo version/ {print $2}')
99
+ MIN_VERSION="1.0.0-beta.3"
100
+
101
+ version_gte() {
102
+ [ "$(printf '%s\n' "$1" "$2" | sort -V | head -n1)" = "$2" ]
103
+ }
104
+
105
+ if version_gte "$VERSION" "$MIN_VERSION"; then
106
+ noir-profiler --version
107
+ fi
53
108
54
109
install-source :
55
110
name : Noir ${{matrix.version}} (from source) on ${{matrix.os == 'ubuntu' && 'Linux' || matrix.os == 'macos' && 'macOS' || matrix.os == 'windows' && 'Windows' || '???'}}
111
+ needs : [noir-version-list]
56
112
runs-on : ${{matrix.os}}-latest
57
113
strategy :
58
114
fail-fast : false
59
115
matrix :
60
- os : [ubuntu, macos]
61
116
# Installing from source can technically target any commit.
62
117
# However, we only guarantee that noirup will build release commits.
63
- version : [0.1.0, 0.1.1, 0.2.0, 0.3.0, 0.4.1]
118
+ os : [ubuntu, macos]
119
+ version : ${{ fromJson( needs.noir-version-list.outputs.noir_versions )}}
64
120
timeout-minutes : 45
65
121
steps :
66
122
- name : Install noirup
@@ -80,29 +136,57 @@ jobs:
80
136
~/.cargo/git/db/
81
137
key : ${{ runner.os }}-cargo-${{ matrix.version }}
82
138
83
- - name : Install Barretenberg dependencies
84
- if : matrix.os == 'ubuntu'
85
- run : sudo apt update && sudo apt install clang lld cmake libomp-dev
86
-
87
- - name : Install Barretenberg dependencies
88
- if : matrix.os == 'macos'
89
- run : brew install cmake llvm libomp
90
-
91
139
- name : Install nargo from source with noirup
92
140
run : noirup $toolchain
93
141
env :
94
- toolchain : -b tags/v ${{matrix.version}}
142
+ toolchain : -b tags/${{matrix.version}}
95
143
- name : Check nargo installation
96
144
run : nargo --version
145
+ - name : Check noir-inspector installation
146
+ run : |
147
+ # Fetch the version from `nargo` as to also check the `stable` and `nightly` toolchains
148
+ VERSION=$(nargo --version | awk -F' = ' '/nargo version/ {print $2}')
149
+ MIN_VERSION="1.0.0-beta.3"
150
+
151
+ version_gte() {
152
+ [ "$(printf '%s\n' "$1" "$2" | sort -V | head -n1)" = "$2" ]
153
+ }
154
+
155
+ if version_gte "$VERSION" "$MIN_VERSION"; then
156
+ noir-inspector --version
157
+ fi
158
+ - name : Check noir-profiler installation
159
+ run : |
160
+ # Minimum version which began releasing binaries for the `noir-profiler`
161
+ # Account for the extra `v` that prefixes "${{matrix.version}}"
162
+ MIN_VERSION="v1.0.0-beta.3"
163
+
164
+ version_gte() {
165
+ [ "$(printf '%s\n' "$1" "$2" | sort -V | head -n1)" = "$2" ]
166
+ }
167
+
168
+ if version_gte ${{matrix.version}} "$MIN_VERSION"; then
169
+ noir-profiler --version
170
+ fi
97
171
98
172
install-action :
99
173
name : Noir ${{matrix.toolchain}} (GH action) on ${{matrix.os == 'ubuntu' && 'Linux' || matrix.os == 'macos' && 'macOS' || matrix.os == 'windows' && 'Windows' || '???'}}
174
+ needs : [noir-version-list]
100
175
runs-on : ${{matrix.os}}-latest
101
176
strategy :
102
177
fail-fast : false
103
178
matrix :
104
179
os : [ubuntu, macos]
105
- toolchain : [stable, nightly, 0.1.0, 0.1.1, 0.2.0, 0.3.0, 0.4.1]
180
+ toolchain : ${{ fromJson( needs.noir-version-list.outputs.noir_versions )}}
181
+ include :
182
+ - os : ubuntu
183
+ toolchain : nightly
184
+ - os : ubuntu
185
+ toolchain : stable
186
+ - os : macos
187
+ toolchain : nightly
188
+ - os : macos
189
+ toolchain : stable
106
190
timeout-minutes : 45
107
191
steps :
108
192
- uses : actions/checkout@v3
@@ -115,22 +199,34 @@ jobs:
115
199
- run : nargo new project
116
200
- run : nargo check
117
201
working-directory : ./project
118
- - run : |
119
- # Extract the minor version number from the version output
120
- version=$(nargo --version)
121
- version="${version#* }"
122
- version="${version%% (*}"
123
- minor=$(echo $version | cut -d '.' -f 2)
124
-
125
- # The version in which the compile syntax changed
126
- if [ "$minor" -lt 10 ]; then
127
- nargo compile test-circuit
128
- else
129
- nargo compile
130
- fi
131
- name: nargo compile
202
+ - run : nargo compile
132
203
working-directory : ./project
133
- shell: bash
134
204
- run : nargo test
135
- if : matrix.toolchain != '0.1.0'
136
205
working-directory : ./project
206
+ - name : Check noir-inspector installation
207
+ run : |
208
+ # Fetch the version from `nargo` as to also check the `stable` and `nightly` toolchains
209
+ VERSION=$(nargo --version | awk -F' = ' '/nargo version/ {print $2}')
210
+ MIN_VERSION="1.0.0-beta.3"
211
+
212
+ version_gte() {
213
+ [ "$(printf '%s\n' "$1" "$2" | sort -V | head -n1)" = "$2" ]
214
+ }
215
+
216
+ if version_gte "$VERSION" "$MIN_VERSION"; then
217
+ noir-inspector --version
218
+ fi
219
+ - name : Check noir-profiler installation
220
+ working-directory : ./project
221
+ run : |
222
+ VERSION=$(nargo --version | awk -F' = ' '/nargo version/ {print $2}')
223
+ MIN_VERSION="1.0.0-beta.3"
224
+
225
+ version_gte() {
226
+ [ "$(printf '%s\n' "$1" "$2" | sort -V | head -n1)" = "$2" ]
227
+ }
228
+
229
+ if version_gte "$VERSION" "$MIN_VERSION"; then
230
+ noir-profiler --version
231
+ noir-profiler opcodes -a ./target/project.json -o ./target
232
+ fi
0 commit comments