diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 1700886b3..67716d1a3 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -7,7 +7,7 @@ on: - '**/*.md' branches: - main -permissions: +permissions: contents: read jobs: go_unit_tests: @@ -23,7 +23,12 @@ jobs: run: | go get gotest.tools/gotestsum@v0.4.2 # TODO: validate bin/protoc-go.sh does not dirty the repo - gotestsum -- -cover -race -v -mod=readonly ./... + gotestsum -- -cover -coverprofile=coverage.out -race -v -mod=readonly ./... + - name: Upload coverage to Codecov + uses: codecov/codecov-action@29386c70ef20e286228c72b668a06fd0e8399192 + with: + files: ./coverage.out + flags: unittests,golang js_unit_tests: name: JS unit tests timeout-minutes: 30 @@ -40,4 +45,9 @@ jobs: export PATH="$HOME/.yarn/bin:$PATH" export NODE_ENV=test bin/web --frozen-lockfile - bin/web test --reporters="jest-dot-reporter" --reporters="./gh_ann_reporter.js" + bin/web test --reporters="jest-dot-reporter" --reporters="./gh_ann_reporter.js" --coverage + - name: Upload coverage to Codecov + uses: codecov/codecov-action@29386c70ef20e286228c72b668a06fd0e8399192 + with: + directory: ./web/app/coverage + flags: unittests,javascript diff --git a/.gitignore b/.gitignore index bd39aead6..55ceac7c1 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ vendor **/charts/**/charts package-lock.json .vscode +**/coverage*