From c386adb42a1391ba0ae957f52bee7513569217b6 Mon Sep 17 00:00:00 2001 From: max funk Date: Sun, 7 Jan 2024 22:50:29 -0700 Subject: [PATCH] rust httpclient workflow --- .github/workflows/dev-crates.yaml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dev-crates.yaml b/.github/workflows/dev-crates.yaml index 107a0974..683f1217 100644 --- a/.github/workflows/dev-crates.yaml +++ b/.github/workflows/dev-crates.yaml @@ -20,14 +20,12 @@ jobs: - uses: taiki-e/install-action@nextest - name: crates/types lint run: | - cargo fmt -- --check - cargo clippy -- -Dwarnings - working-directory: crates/types + cargo fmt -p pg -p types -p httpclient -- --check + cargo clippy -p pg -p types -p httpclient -- -Dwarnings - name: install cargo-llvm-cov uses: taiki-e/install-action@cargo-llvm-cov - name: crates/types unit tests - run: cargo test - working-directory: crates/types + run: cargo test -p pg -p types -p httpclient - name: crates/types coverage report run: | make rust-coverage RUST_PKG=types @@ -45,6 +43,17 @@ jobs: echo "MIN_CODE_COV=$(yq .crates.pg.min_code_cov project.yaml)" >> $GITHUB_ENV echo "CURR_CODE_COV=$(make rust-coverage-percent RUST_PKG=pg)" >> $GITHUB_ENV - name: fail crates/pg coverage under ${{ env.MIN_CODE_COV }}% + run: | + if [[ ${{ env.CURR_CODE_COV }} -lt ${{ env.MIN_CODE_COV }} ]]; then + echo 'coverage dropped below ${{ env.MIN_CODE_COV }}: ${{ env.CURR_CODE_COV }}%' + exit 1 + fi + - name: crates/httpcrate coverage report + run: | + make rust-coverage RUST_PKG=httpcrate + echo "MIN_CODE_COV=$(yq .crates.httpcrate.min_code_cov project.yaml)" >> $GITHUB_ENV + echo "CURR_CODE_COV=$(make rust-coverage-percent RUST_PKG=httpcrate)" >> $GITHUB_ENV + - name: fail crates/httpcrate coverage under ${{ env.MIN_CODE_COV }}% run: | if [[ ${{ env.CURR_CODE_COV }} -lt ${{ env.MIN_CODE_COV }} ]]; then echo 'coverage dropped below ${{ env.MIN_CODE_COV }}: ${{ env.CURR_CODE_COV }}%'