Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Only run checks on Cargo.toml changes #1491

Merged
merged 2 commits into from
Feb 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions .github/workflows/check-each.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Check each crate independently. Helps to catch dependency issues.
#
# Code changes are exercised via the `test` and `lint` workflows. This workflow just checks that
# each crate's `Cargo.toml` is configured sufficiently so that each crate can be compiled on its
# own.
name: check-each

permissions:
Expand All @@ -7,14 +11,13 @@ permissions:
on:
pull_request:
paths:
- Cargo.lock
- "**/*.rs"
- "**/Cargo.toml"
- .github/workflows/check-each.yml

env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
DEBIAN_FRONTEND: noninteractive
RUST_BACKTRACE: short
RUSTUP_MAX_RETRIES: 10

Expand All @@ -24,17 +27,16 @@ jobs:
runs-on: ubuntu-latest
container:
image: docker://rust:1.56.1-buster
env:
DEBIAN_FRONTEND: noninteractive
steps:
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
- run: apt update && apt install -y jq
- run: cargo fetch
- name: list crates
id: list-crates
run: |
echo "::set-output name=crates::$(cargo metadata --frozen --format-version=1 \
| jq -cr "[.packages[] | select(.manifest_path | startswith(\"$PWD\")) | .name | select(. != \"linkerd-meshtls-boring\")]")"
crates=$(cargo metadata --frozen --format-version=1 \
| jq -cr "[.packages[] | select(.manifest_path | startswith(\"$PWD\")) | .name]")
echo "::set-output name=crates::$crates"
outputs:
crates: ${{ steps.list-crates.outputs.crates }}`

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