From 7861a707cd7871e71517ebf603641a00b8c0e8c7 Mon Sep 17 00:00:00 2001 From: Joel Speed Date: Wed, 7 Oct 2020 18:08:16 +0100 Subject: [PATCH 1/4] Fix name of test report ID variable --- test.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test.sh b/test.sh index c4f6ef85..114940b1 100755 --- a/test.sh +++ b/test.sh @@ -2,8 +2,8 @@ # manually exiting from script, because after-build needs to run always set +e -if [ -z $CC_TEST_REPORT_ID ]; then - echo "1. CC_TEST_REPORT_ID is unset, skipping" +if [ -z $CC_TEST_REPORTER_ID ]; then + echo "1. CC_TEST_REPORTER_ID is unset, skipping" else echo "1. Running before-build" ./cc-test-reporter before-build @@ -14,8 +14,8 @@ make test TEST_STATUS=$? echo "TEST_STATUS: ${TEST_STATUS}" -if [ -z $CC_TEST_REPORT_ID ]; then - echo "3. CC_TEST_REPORT_ID is unset, skipping" +if [ -z $CC_TEST_REPORTER_ID ]; then + echo "3. CC_TEST_REPORTER_ID is unset, skipping" else echo "3. Running after-build" ./cc-test-reporter after-build --exit-code $TEST_STATUS -t gocov From b848663a3d74fd33dbce1aa8a2ec5ec65bdcc7bd Mon Sep 17 00:00:00 2001 From: Joel Speed Date: Wed, 7 Oct 2020 18:14:41 +0100 Subject: [PATCH 2/4] Move test script to workflows folder --- .github/workflows/ci.yaml | 2 +- test.sh => .github/workflows/test.sh | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename test.sh => .github/workflows/test.sh (100%) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1b0d26c4..9aab298c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -45,7 +45,7 @@ jobs: env: CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} run: | - ./test.sh + ./.github/workflows/test.sh docker: runs-on: ubuntu-18.04 diff --git a/test.sh b/.github/workflows/test.sh similarity index 100% rename from test.sh rename to .github/workflows/test.sh From 70c585812e338a9ac48bfcdbbda5b13c01a9e2dc Mon Sep 17 00:00:00 2001 From: Joel Speed Date: Wed, 7 Oct 2020 18:22:38 +0100 Subject: [PATCH 3/4] Fix coverage file path recognition --- .github/workflows/test.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test.sh b/.github/workflows/test.sh index 114940b1..e17aa713 100755 --- a/.github/workflows/test.sh +++ b/.github/workflows/test.sh @@ -12,13 +12,12 @@ fi echo "2. Running test" make test TEST_STATUS=$? -echo "TEST_STATUS: ${TEST_STATUS}" if [ -z $CC_TEST_REPORTER_ID ]; then echo "3. CC_TEST_REPORTER_ID is unset, skipping" else echo "3. Running after-build" - ./cc-test-reporter after-build --exit-code $TEST_STATUS -t gocov + ./cc-test-reporter after-build --exit-code $TEST_STATUS -t gocov --prefix $(basename $(go list -m)) fi if [ "$TEST_STATUS" -ne 0 ]; then From 132c2cb2103940468bd62d6c6e49cd3ee2b7d631 Mon Sep 17 00:00:00 2001 From: Joel Speed Date: Wed, 7 Oct 2020 18:49:32 +0100 Subject: [PATCH 4/4] Add changelog for fixing test reporting in github actions --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62a9c5ac..eaca5c86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ ## Changes since v6.1.1 +- [#825](https://github.com/oauth2-proxy/oauth2-proxy/pull/825) Fix code coverage reporting on GitHub actions(@JoelSpeed) - [#705](https://github.com/oauth2-proxy/oauth2-proxy/pull/705) Add generic Header injectors for upstream request and response headers (@JoelSpeed) - [#753](https://github.com/oauth2-proxy/oauth2-proxy/pull/753) Pass resource parameter in login url (@codablock) - [#789](https://github.com/oauth2-proxy/oauth2-proxy/pull/789) Add `--skip-auth-route` configuration option for `METHOD=pathRegex` based allowlists (@NickMeves)