From 6811c80b690d6a469db1d5f4d8241fe199187e16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Ho=C3=9F?= Date: Sat, 4 Nov 2023 15:52:46 +0100 Subject: [PATCH] only checked changed CRDs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sebastian Hoß --- .github/workflows/verify.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 2f9344294..b8a96b70d 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -10,20 +10,19 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Set up Rust uses: dtolnay/rust-toolchain@stable - name: Cache Dependencies uses: Swatinem/rust-cache@v2 - name: Check Code Generator run: cargo check --package code-generator --locked - - name: Check all CRDs + - name: Check changed CRDs run: | - for mld in ./kube-custom-resources-rs/src/*; do - if [ -f "${mld}/mod.rs" ]; then - module=$(basename "${mld}") - echo "testing ${module}" - cargo check --package kube-custom-resources-rs --features "${module}" --locked - fi + for module in $(git diff --name-only origin/main -- ./kube-custom-resources-rs/src | grep --invert-match lib.rs | xargs --no-run-if-empty -I{} dirname {} | sort --unique | xargs --no-run-if-empty -I{} basename {}); do + echo "testing ${module}" + cargo check --package kube-custom-resources-rs --features "${module}" --locked done env: RUSTFLAGS: "-A warnings"