From 0a4f2e642e30c06cae1375018b54f8ebc40dc0bf Mon Sep 17 00:00:00 2001 From: Ivan Kozlovic Date: Mon, 9 Oct 2023 11:38:21 -0600 Subject: [PATCH] Fixed code coverage GithHub Action Signed-off-by: Ivan Kozlovic --- .github/workflows/cov.yaml | 4 +++- scripts/cov.sh | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cov.yaml b/.github/workflows/cov.yaml index 8331f9cb..ab1d4dab 100644 --- a/.github/workflows/cov.yaml +++ b/.github/workflows/cov.yaml @@ -28,6 +28,7 @@ jobs: shell: bash --noprofile --norc -x -eo pipefail {0} run: | set -e + cd src/github.com/nats-io/nats-server ./scripts/cov.sh upload set +e @@ -35,9 +36,10 @@ jobs: uses: jandelgado/gcov2lcov-action@v1.0.9 with: infile: acc.out + working-directory: src/github.com/nats-io/nats-server - name: Coveralls uses: coverallsapp/github-action@v2 with: github-token: ${{ secrets.github_token }} - path-to-lcov: coverage.lcov + file: src/github.com/nats-io/nats-server/coverage.lcov diff --git a/scripts/cov.sh b/scripts/cov.sh index 91a8a421..97b76e65 100755 --- a/scripts/cov.sh +++ b/scripts/cov.sh @@ -33,8 +33,12 @@ mkdir cov # go test -v -covermode=atomic -coverprofile=./cov/conf.out ./conf -timeout=1h -tags=skip_no_race_tests check_file "conf" "conf.out" +go test -v -covermode=atomic -coverprofile=./cov/internal.out ./internal/ldap -timeout=1h -tags=skip_no_race_tests +check_file "internal" "internal.out" go test -v -covermode=atomic -coverprofile=./cov/log.out ./logger -timeout=1h -tags=skip_no_race_tests check_file "logger" "log.out" +go test -v -covermode=atomic -coverprofile=./cov/server_avl.out ./server/avl -timeout=1h -tags=skip_no_race_tests +check_file "server_avl" "server_avl.out" go test -v -covermode=atomic -coverprofile=./cov/server.out ./server -timeout=1h -tags=skip_no_race_tests check_file "server" "server.out" go test -v -covermode=atomic -coverprofile=./cov/test.out -coverpkg=./server ./test -timeout=1h -tags=skip_no_race_tests