mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-09 03:55:04 -05:00
chore(tools): update coverage.sh script
This commit is contained in:
@@ -56,8 +56,7 @@ jobs:
|
||||
id: coverage
|
||||
if: ${{ steps.pytest.outcome != 'skipped' && !cancelled() }}
|
||||
run: |
|
||||
bash --noprofile --norc -o pipefail \
|
||||
script/actions_utils/coverage.sh ${{ github.base_ref }}
|
||||
./script/actions_utils/coverage.sh ${{ github.base_ref }}
|
||||
- name: Archive test coverage
|
||||
uses: actions/upload-artifact@v2
|
||||
if: ${{ steps.coverage.outcome != 'skipped' && !cancelled() }}
|
||||
|
||||
13
script/actions_utils/coverage.sh
Normal file → Executable file
13
script/actions_utils/coverage.sh
Normal file → Executable file
@@ -1,3 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -o pipefail
|
||||
set +e
|
||||
|
||||
CURR_DIR=`dirname $0`
|
||||
|
||||
# Run diff-coverage
|
||||
@@ -9,11 +14,9 @@ poetry run diff-cover coverage.xml --fail-under 100 \
|
||||
TEST_EXIT_CODE="$?"
|
||||
|
||||
# Format diff-coverage.txt for PR comment
|
||||
poetry run python script/actions_utils/coverage_report_format.py \
|
||||
poetry run python "$CURR_DIR"/coverage_report_format.py \
|
||||
--diff-cover-exit-code "$TEST_EXIT_CODE" \
|
||||
--diff-cover-output diff-coverage.txt
|
||||
|
||||
# Set exit code if test failed
|
||||
if [[ "$TEST_EXIT_CODE" != "0" ]]; then
|
||||
exit "$TEST_EXIT_CODE"
|
||||
fi
|
||||
# Set exit code to the diff coverage check
|
||||
exit "$TEST_EXIT_CODE"
|
||||
|
||||
Reference in New Issue
Block a user