Skip to content

Commit

Permalink
ci: fix action comp
Browse files Browse the repository at this point in the history
Signed-off-by: Marko Kungla <[email protected]>
  • Loading branch information
mkungla committed Jan 29, 2024
1 parent 67eced7 commit 9f5bf7e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ Get-ChildItem -File -Recurse -Filter "go.mod" | ForEach-Object {
$modules += $module

# Run tests only if ONLY_MODULE_LIST is not "true"
if ($ONLY_MODULE_LIST -ne "true") {
if ($ONLY_MODULE_LIST != "true") {
Write-Host "Testing and generating coverage for module: $module"
Set-Location $module
if ($GO_TEST_RACE -eq "true") {
if ($GO_TEST_RACE == "true") {
go test -race -coverpkg=./... -coverprofile=coverage.out -timeout=1m ./...
} else {
go test -coverpkg=./... -coverprofile=coverage.out -timeout=1m ./...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ while IFS= read -r module; do
modules+=("$module")

# Run tests only if ONLY_MODULE_LIST is not "true"
if [ "$ONLY_MODULE_LIST" -ne "true" ]; then
if [ "$ONLY_MODULE_LIST" != "true" ]; then
echo "Testing and generating coverage for module: $module"
if [ "$GO_TEST_RACE" -eq "true" ]; then
if [ "$GO_TEST_RACE" == "true" ]; then
(cd "$module" && go test -race -coverpkg=./... -coverprofile=coverage.out -timeout=1m ./...)
else
(cd "$module" && go test -coverpkg=./... -coverprofile=coverage.out -timeout=1m ./...)
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/monorepo-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
go-version: '>=1.21.0'
only-module-list: true

coverage:
test-n-coverage:
needs: list-modules
strategy:
matrix:
Expand All @@ -63,7 +63,7 @@ jobs:
race: ${{ github.event.inputs.loose != 'true' }}

- name: Check if coverage data exists
if: success() || failure()
if: github.event.inputs.loose == 'true' || success()
id: check-coverage
working-directory: ${{ matrix.module }}
run: |
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
file: ${{ matrix.module }}/coverage.out

finish-coverage-report:
needs: coverage
needs: test-n-coverage
if: github.event.inputs.loose == 'true' || success()
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit 9f5bf7e

Please sign in to comment.