Skip to content

Commit cb16d94

Browse files
committed
A few more CI workflow comment and style improvements
These didn't make it into GitoxideLabs#1668. Besides comments, the changes are for consistency with the prevailing style, usually by omitting redundant YAML quoting. Removal of the outer double quotes in the `if` in `tests-pass` is a case of this, and produces an equivalent node in parsing (i.e. its equivalence does not depend on anything about GHA itself). But just to be sure, I did run yq '.jobs.tests-pass.steps[0].if' .github/workflows/ci.yml before and after the change, to ensure the output was the same. The other change here that deserves comment is the removal of `--` as an argument to a `diff` command. When any path argument is formed from paramter expansion or from a glob with a leading `*` or other globbing character, `--` helps express that the following arguments are not options. For `git diff`, a `--` expresses that the following arguments are neither options nor refs, but paths, so all `git diff` commands with paths in the CI workflows use `--` even if no shell expansions are involved. (In practice this means `--` is often useful for `diff` with paths and, based on this habit, I had inadvertently written a `--` where neither of the above scenarios applied. But that had actually decreased stylistic consistency because we are not using `--` elsewhere that the meaning of all arguments after it is unambiguous even without examining any surrounding context.)
1 parent 0155aec commit cb16d94

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,14 @@ jobs:
8484
- uses: Swatinem/rust-cache@v2
8585
- name: Setup dependencies (macos)
8686
if: startsWith(matrix.os, 'macos')
87-
run:
88-
brew install tree openssl gnu-sed
87+
run: brew install tree openssl gnu-sed
8988
- name: "cargo check default features"
9089
if: startsWith(matrix.os, 'windows')
9190
run: cargo check --workspace --bins --examples
9291
- uses: taiki-e/install-action@v2
9392
with:
9493
tool: nextest
95-
- name: "Test (nextest)"
94+
- name: Test (nextest)
9695
env:
9796
GIX_TEST_CREATE_ARCHIVES_EVEN_ON_CI: '1'
9897
run: cargo nextest run --workspace --no-fail-fast
@@ -157,9 +156,9 @@ jobs:
157156
- uses: taiki-e/install-action@v2
158157
with:
159158
tool: cross
160-
- name: "check"
159+
- name: check
161160
run: cross check -p gix --target ${{ matrix.target }}
162-
- name: "Test (unit)"
161+
- name: Test (unit)
163162
# run high-level unit tests that exercise a lot of code while being pure Rust to ease building test binaries.
164163
# TODO: figure out why `git` doesn't pick up environment configuration so build scripts fail when using `-p gix`.
165164
run: cross test -p gix-hashtable --target ${{ matrix.target }}
@@ -275,7 +274,7 @@ jobs:
275274

276275
defaults:
277276
run:
278-
shell: bash
277+
shell: bash # Use bash even on Windows, if we ever reenable windows-latest for testing.
279278

280279
steps:
281280
- uses: actions/checkout@v4
@@ -327,7 +326,7 @@ jobs:
327326
- name: Each job must block PRs or be declared not to
328327
run: |
329328
sort -m blocking-jobs.txt expected-nonblocking-jobs.txt |
330-
diff --color=always -U1000 -- - all-jobs.txt
329+
diff --color=always -U1000 - all-jobs.txt
331330
332331
# Dummy job to have a stable name for the "all tests pass" requirement
333332
tests-pass:
@@ -349,7 +348,7 @@ jobs:
349348

350349
steps:
351350
- name: Fail if ANY dependency has failed or cancelled
352-
if: "contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')"
351+
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
353352
run: exit 1
354353
- name: OK
355354
run: exit 0

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
workflow_dispatch:
1414

1515
permissions:
16-
contents: read # Set more permissively in jobs that need `write`.
16+
contents: read # This is set more permissively in jobs that need `write`.
1717

1818
defaults:
1919
run:

0 commit comments

Comments
 (0)