Skip to content

Commit 96d5058

Browse files
authored
Infrastructure fixes (#220)
- Use simple-markdown-parser - Updates to READMEs - Update dependencies & run clippy - Relax wasm-bindgen version in checker (fixes #222) - Change CFG on update-self (fixes #223) - Finish expectation on build test - Change NaN representation & remove ordered_float (fixes #224) - Add names to asserts diagnostics - More number things under flag - Fix property things - Rename Modulo to more correct Remainder - Fixes to narrowing and add string escapes
1 parent eeec0f8 commit 96d5058

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+2492
-1905
lines changed

.github/workflows/lines-of-code.yml

+7-8
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,22 @@ jobs:
2323
- name: Run update script
2424
run: |
2525
function record {
26-
cratePath=$1
26+
crate_path=$1
2727
name=$2
2828
29-
if [ -d "$cratePath/src" ] ; then
30-
linesOfRustCode=$(scc -c --no-cocomo -f json -i rs "$cratePath/src" | jq '.[] | .Code');
29+
if [ -d "$crate_path/src" ] ; then
30+
lines_of_code=$(scc -c --no-cocomo -f json -i rs "$crate_path/src" | jq '.[] | .Code');
3131
else
32-
linesOfRustCode=$(scc -c --no-cocomo -f json -i rs "$cratePath" | jq '.[] | .Code');
32+
lines_of_code=$(scc -c --no-cocomo -f json -i rs "$crate_path" | jq '.[] | .Code');
3333
fi
3434
35-
echo "\`$name\` has $linesOfRustCode lines of code" >> $GITHUB_STEP_SUMMARY;
35+
echo "\`$name\` has $lines_of_code lines of code" >> $GITHUB_STEP_SUMMARY;
3636
3737
curl \
3838
--header "Content-Type: application/json" \
3939
--header "X-POST-ACCESS-KEY: ${{ secrets.PROJECTS_POST_ACCESS_KEY }}" \
40-
--data "{\"project\":\"$name\",\"language\":\"rust\",\"loc\":$linesOfRustCode}" \
41-
-w "\nUpdated-project: \n" \
42-
https://projects.kaleidawave.workers.dev/update-project;
40+
--data "{\"project\":\"$name\",\"language\":\"rust\",\"loc\":$lines_of_code}" \
41+
https://kaleidawave-projectinformation.web.val.run/update-project;
4342
}
4443
4544
record "parser" "ezno-parser"

.github/workflows/performance-and-size.yml

+46-29
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,37 @@ jobs:
2727

2828
- uses: brndnmtthws/rust-action-cargo-binstall@v1
2929
with:
30-
packages: hyperfine
30+
packages: hyperfine ripgrep
3131

3232
- name: Install valgrind
3333
run: sudo apt-get install valgrind
3434

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+
3548
- name: Build Ezno
3649
run: cargo build --release
3750
env:
3851
CARGO_PROFILE_RELEASE_DEBUG: true
3952

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 }}
4961

5062
- name: Set compilers
5163
id: compilers
@@ -134,14 +146,14 @@ jobs:
134146
shell: bash
135147
if: github.ref_name != 'main'
136148
run: |
137-
echo "::group::Running all"
149+
echo "::group::Running with staging"
138150
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
141153
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
143156
144-
hyperfine -i -L compiler ${{ steps.compilers.outputs.BINARIES }} '{compiler} check all.tsx'
145157
echo "::endgroup::"
146158
147159
- name: Run checker performance on large file
@@ -167,19 +179,24 @@ jobs:
167179
run: |
168180
IFS=',' read -ra ITEMS <<< ${{ steps.compilers.outputs.BINARIES }}
169181
182+
export RUST_BACKTRACE=1
183+
170184
for compiler in ${ITEMS[@]}; do
171185
echo "::group::Running $compiler"
172186
173187
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)"
177193
echo "::endgroup::"
178-
194+
179195
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)"
183200
echo "::endgroup::"
184201
185202
echo "::endgroup::"
@@ -205,10 +222,10 @@ jobs:
205222
echo "::endgroup::"
206223
done
207224
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

Comments
 (0)