From 9b5d557d54e717bfd38bf6226a3483d31760e836 Mon Sep 17 00:00:00 2001 From: Sijie Date: Tue, 2 Jan 2024 18:23:52 -0500 Subject: [PATCH] fix GHA --- .github/workflows/kb_sdk_test.yaml | 6 +++++- Makefile | 8 ++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/kb_sdk_test.yaml b/.github/workflows/kb_sdk_test.yaml index 386b3452..ebb0a1bd 100644 --- a/.github/workflows/kb_sdk_test.yaml +++ b/.github/workflows/kb_sdk_test.yaml @@ -54,4 +54,8 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} run: | sh $GITHUB_WORKSPACE/kb_sdk_actions/bin/kb-sdk test - bash <(curl -s https://codecov.io/bash) + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + fail_ci_if_error: true diff --git a/Makefile b/Makefile index c0867b95..80b247c3 100644 --- a/Makefile +++ b/Makefile @@ -51,15 +51,15 @@ build-test-script: echo 'export PYTHONPATH=$$script_dir/../$(LIB_DIR):$$PATH:$$PYTHONPATH' >> $(TEST_DIR)/$(TEST_SCRIPT_NAME) echo 'cd $$script_dir/../$(TEST_DIR)' >> $(TEST_DIR)/$(TEST_SCRIPT_NAME) echo 'python -m nose --with-coverage --cover-package=$(SERVICE_CAPS) --cover-html --cover-html-dir=/kb/module/work/test_coverage --cover-xml --cover-xml-file=/kb/module/work/test_coverage/coverage.xml --nocapture --nologcapture .' >> $(TEST_DIR)/$(TEST_SCRIPT_NAME) - echo 'cp /kb/module/.coveragerc .' >> $(TEST_DIR)/$(TEST_SCRIPT_NAME) - echo 'cp .coverage /kb/module/work/' >> $(TEST_DIR)/$(TEST_SCRIPT_NAME) - echo 'mkdir -p /kb/module/work/kb/module/lib/' >> $(TEST_DIR)/$(TEST_SCRIPT_NAME) - echo 'cp -R /kb/module/lib/$(SERVICE_CAPS)/ /kb/module/work/kb/module/lib/' >> $(TEST_DIR)/$(TEST_SCRIPT_NAME) chmod +x $(TEST_DIR)/$(TEST_SCRIPT_NAME) test: if [ ! -f /kb/module/work/token ]; then echo -e '\nOutside a docker container please run "kb-sdk test" rather than "make test"\n' && exit 1; fi bash $(SCRIPTS_DIR)/$(TEST_SCRIPT_NAME) + cp /kb/module/.coveragerc $(TEST_DIR)/. + cp $(TEST_DIR)/.coverage /kb/module/work/ + mkdir -p /kb/module/work/kb/module/lib/ + cp -R /kb/module/lib/$(SERVICE_CAPS)/ /kb/module/work/kb/module/lib/ clean: rm -rfv $(LBIN_DIR)