Skip to content

Commit 241dcdb

Browse files
committed
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.
1 parent 83e1b73 commit 241dcdb

File tree

1 file changed

+31
-6
lines changed

1 file changed

+31
-6
lines changed

.github/workflows/ci.yml

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -387,14 +387,39 @@ jobs:
387387
if: endsWith(matrix.target, '-wasi')
388388
run: |
389389
set +x
390-
for name in gix-sec; do
391-
(cd -- "$name" && cargo build --target "$TARGET")
390+
for crate in gix-sec; do
391+
(cd -- "$crate" && cargo build --target "$TARGET")
392392
done
393393
- name: crates without feature toggles
394394
run: |
395+
crates=(
396+
gix-actor
397+
gix-attributes
398+
gix-bitmap
399+
gix-chunk
400+
gix-command
401+
gix-commitgraph
402+
gix-config-value
403+
gix-date
404+
gix-glob
405+
gix-hash
406+
gix-hashtable
407+
gix-mailmap
408+
gix-object
409+
gix-packetline
410+
gix-path
411+
gix-pathspec
412+
gix-prompt
413+
gix-quote
414+
gix-refspec
415+
gix-revision
416+
gix-traverse
417+
gix-url
418+
gix-validate
419+
)
395420
set +x
396-
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
397-
(cd -- "$name" && cargo build --target "$TARGET")
421+
for crate in "${crates[@]}"; do
422+
(cd -- "$crate" && cargo build --target "$TARGET")
398423
done
399424
- name: features of gix-features
400425
run: |
@@ -405,8 +430,8 @@ jobs:
405430
- name: crates with 'wasm' feature
406431
run: |
407432
set +x
408-
for name in gix-pack; do
409-
(cd -- "$name" && cargo build --features wasm --target "$TARGET")
433+
for crate in gix-pack; do
434+
(cd -- "$crate" && cargo build --features wasm --target "$TARGET")
410435
done
411436
- name: gix-pack with all features (including wasm)
412437
run: cd gix-pack && cargo build --all-features --target "$TARGET"

0 commit comments

Comments
 (0)