@@ -27,25 +27,37 @@ jobs:
27
27
28
28
- uses : brndnmtthws/rust-action-cargo-binstall@v1
29
29
with :
30
- packages : hyperfine
30
+ packages : hyperfine ripgrep
31
31
32
32
- name : Install valgrind
33
33
run : sudo apt-get install valgrind
34
34
35
+ - name : Get last run
36
+ id : get-last-run
37
+ run : |
38
+ # First result should come up within 10 runs from main
39
+ id=$(gh api \
40
+ -H "Accept: application/vnd.github+json" \
41
+ -H "X-GitHub-Api-Version: 2022-11-28" \
42
+ '/repos/kaleidawave/ezno/actions/runs?branch=main&per_page=10' \
43
+ --jq '[.workflow_runs[] | select(.path == ".github/workflows/examples.yml")][0].id')
44
+ echo "run_id=$id" >> "$GITHUB_OUTPUT"
45
+ env :
46
+ GH_TOKEN : ${{ github.token }}
47
+
35
48
- name : Build Ezno
36
49
run : cargo build --release
37
50
env :
38
51
CARGO_PROFILE_RELEASE_DEBUG : true
39
52
40
- # TODO need to lookup existing workflow on main
41
- # even if this worked, it might have issues with newer features added in this run
42
- # - name: Get base ezno
43
- # if: github.ref_name != 'main'
44
- # uses: actions/download-artifact@v4
45
- # continue-on-error: true
46
- # with:
47
- # name: latest-checker
48
- # path: previous-ezno
53
+ - name : Get base ezno
54
+ if : github.ref_name != 'main'
55
+ uses : actions/download-artifact@v4
56
+ continue-on-error : true
57
+ with :
58
+ name : latest-checker
59
+ path : previous-ezno
60
+ run-id : ${{ steps.get-last-run.outputs.run_id }}
49
61
50
62
- name : Set compilers
51
63
id : compilers
@@ -134,14 +146,14 @@ jobs:
134
146
shell : bash
135
147
if : github.ref_name != 'main'
136
148
run : |
137
- echo "::group::Running all "
149
+ echo "::group::Running with staging "
138
150
139
- cat ./checker/specification/specification.md ./checker/specification/staging.md > all .md
140
- cargo run -p ezno-parser --example code_blocks_to_script all .md --comment-headers --out ./all .tsx
151
+ cat ./checker/specification/specification.md ./checker/specification/staging.md > with-staging .md
152
+ cargo run -p ezno-parser --example code_blocks_to_script with-staging .md --comment-headers --out ./with-staging .tsx
141
153
142
- ./target/release/ezno check all.tsx --timings || true
154
+ ./target/release/ezno check with-staging.tsx --timings || true
155
+ ./target/release/ezno check with-staging.tsx --timings || true
143
156
144
- hyperfine -i -L compiler ${{ steps.compilers.outputs.BINARIES }} '{compiler} check all.tsx'
145
157
echo "::endgroup::"
146
158
147
159
- name : Run checker performance on large file
@@ -167,19 +179,24 @@ jobs:
167
179
run : |
168
180
IFS=',' read -ra ITEMS <<< ${{ steps.compilers.outputs.BINARIES }}
169
181
182
+ export RUST_BACKTRACE=1
183
+
170
184
for compiler in ${ITEMS[@]}; do
171
185
echo "::group::Running $compiler"
172
186
173
187
echo "::group::Callgrind"
174
- valgrind --tool=callgrind --callgrind-out-file=cpu-out $compiler check demo.tsx | true
175
- echo "CPU usage:"
176
- head -n100 cpu-out
188
+ {
189
+ valgrind --tool=callgrind --callgrind-out-file=./cpu-out $compiler check demo.tsx --max-diagnostics 0
190
+ } || true
191
+ ls
192
+ echo "::notice::CPU usage:$(rg "summary: (.*)" -or '$1' -N --color never ./cpu_out)"
177
193
echo "::endgroup::"
178
-
194
+
179
195
echo "::group::Valgrind"
180
- valgrind --log-file=memory-out $compiler check demo.tsx | true
181
- echo "Memory usage:"
182
- cat memory-out
196
+ {
197
+ valgrind --log-file=memory-out $compiler check demo.tsx --max-diagnostics 0
198
+ } || true
199
+ echo "::notice::Memory usage:$(rg "([0-9,]*) bytes allocated" -or '$1' -N --color never memory-out)"
183
200
echo "::endgroup::"
184
201
185
202
echo "::endgroup::"
@@ -205,10 +222,10 @@ jobs:
205
222
echo "::endgroup::"
206
223
done
207
224
208
- # - name: Upload checker
209
- # if: github.ref == 'main'
210
- # uses: actions/upload-artifact@v4
211
- # with:
212
- # name: latest-checker
213
- # path: target/release/ezno
214
- # retention-days: 90
225
+ - name : Upload checker
226
+ if : github.ref == 'main'
227
+ uses : actions/upload-artifact@v4
228
+ with :
229
+ name : latest-checker
230
+ path : target/release/ezno
231
+ retention-days : 90
0 commit comments