From 241dcdbb8d8ea398b9c437f564c9afd499f7c380 Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Sun, 4 May 2025 16:21:09 -0400 Subject: [PATCH] Refactor crate loops in CI `wasm` jobs - Use a `bash` array for the long list of crates without feature toggles, to make clear what crates are covered in this loop, and so any changes to the list produce clearer diffs, and to improve the general readability of the workflow. - In each loop, rename the variable from `name` to `crate`, to make the meaning clearer. The other significant kind of loop in this job is over `feature`, so this makes the contrast clear. (Other loops over array items in other jobs in the workflow, where the general variable name `name` could be used, already instead use the more specific variable names `package` and `cmd`.) This may slightly mitigate #1988 in that it makes it easier for the big list to be manually inspected, but it does not fix that issue. --- .github/workflows/ci.yml | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b27871b1b14..9dccd0a5938 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -387,14 +387,39 @@ jobs: if: endsWith(matrix.target, '-wasi') run: | set +x - for name in gix-sec; do - (cd -- "$name" && cargo build --target "$TARGET") + for crate in gix-sec; do + (cd -- "$crate" && cargo build --target "$TARGET") done - name: crates without feature toggles run: | + crates=( + gix-actor + gix-attributes + gix-bitmap + gix-chunk + gix-command + gix-commitgraph + gix-config-value + gix-date + gix-glob + gix-hash + gix-hashtable + gix-mailmap + gix-object + gix-packetline + gix-path + gix-pathspec + gix-prompt + gix-quote + gix-refspec + gix-revision + gix-traverse + gix-url + gix-validate + ) set +x - for name in gix-actor gix-attributes gix-bitmap gix-chunk gix-command gix-commitgraph gix-config-value gix-date gix-glob gix-hash gix-hashtable gix-mailmap gix-object gix-packetline gix-path gix-pathspec gix-prompt gix-quote gix-refspec gix-revision gix-traverse gix-url gix-validate; do - (cd -- "$name" && cargo build --target "$TARGET") + for crate in "${crates[@]}"; do + (cd -- "$crate" && cargo build --target "$TARGET") done - name: features of gix-features run: | @@ -405,8 +430,8 @@ jobs: - name: crates with 'wasm' feature run: | set +x - for name in gix-pack; do - (cd -- "$name" && cargo build --features wasm --target "$TARGET") + for crate in gix-pack; do + (cd -- "$crate" && cargo build --features wasm --target "$TARGET") done - name: gix-pack with all features (including wasm) run: cd gix-pack && cargo build --all-features --target "$TARGET"