Skip to content

Commit 0e2cda9

Browse files
authored
ci: Only run checks on Cargo.toml changes (#1491)
The point of this job is to check that each crate can be built independently (i.e., that it doesn't depend on features pulled in by another crate). This change also updates the workflow to check linkerd-meshtls-boring by installing its build deps. Signed-off-by: Oliver Gould <[email protected]>
1 parent 7f17318 commit 0e2cda9

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

.github/workflows/check-each.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# Check each crate independently. Helps to catch dependency issues.
2+
#
3+
# Code changes are exercised via the `test` and `lint` workflows. This workflow just checks that
4+
# each crate's `Cargo.toml` is configured sufficiently so that each crate can be compiled on its
5+
# own.
26
name: check-each
37

48
permissions:
@@ -7,14 +11,13 @@ permissions:
711
on:
812
pull_request:
913
paths:
10-
- Cargo.lock
11-
- "**/*.rs"
1214
- "**/Cargo.toml"
1315
- .github/workflows/check-each.yml
1416

1517
env:
1618
CARGO_INCREMENTAL: 0
1719
CARGO_NET_RETRY: 10
20+
DEBIAN_FRONTEND: noninteractive
1821
RUST_BACKTRACE: short
1922
RUSTUP_MAX_RETRIES: 10
2023

@@ -24,17 +27,16 @@ jobs:
2427
runs-on: ubuntu-latest
2528
container:
2629
image: docker://rust:1.56.1-buster
27-
env:
28-
DEBIAN_FRONTEND: noninteractive
2930
steps:
3031
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
3132
- run: apt update && apt install -y jq
3233
- run: cargo fetch
3334
- name: list crates
3435
id: list-crates
3536
run: |
36-
echo "::set-output name=crates::$(cargo metadata --frozen --format-version=1 \
37-
| jq -cr "[.packages[] | select(.manifest_path | startswith(\"$PWD\")) | .name | select(. != \"linkerd-meshtls-boring\")]")"
37+
crates=$(cargo metadata --frozen --format-version=1 \
38+
| jq -cr "[.packages[] | select(.manifest_path | startswith(\"$PWD\")) | .name]")
39+
echo "::set-output name=crates::$crates"
3840
outputs:
3941
crates: ${{ steps.list-crates.outputs.crates }}`
4042

@@ -50,5 +52,8 @@ jobs:
5052
steps:
5153
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
5254
- run: cargo fetch
55+
- name: install meshtls-boring build deps
56+
if: matrix.crate == 'linkerd-meshtls-boring'
57+
run: apt update && apt install -y clang cmake
5358
- run: cargo check -p ${{ matrix.crate }} --frozen --all-targets
5459

0 commit comments

Comments
 (0)