Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 46 additions & 23 deletions .github/workflows/go-test-monorepo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ on:

type: string
required: false
no-race:
description: 'runs test without -race'
type: string
required: false
default: 'false'
timeout:
description: 'test timeout'
type: string
required: false
default: '30m'

defaults:
run:
Expand Down Expand Up @@ -160,19 +170,25 @@ jobs:
# * go.work committed to git
env:
EXTRA_FLAGS: ${{ inputs.extra-flags }}
run: >
WANTS_NORACE: ${{ inputs.no-race }}
TIMEOUT: ${{ inputs.timeout }}
run: |
RACEOPT="-race"
if [[ "${WANTS_NORACE}" == "true" ]] ; then
RACEOPT=""
fi

gotestsum
--jsonfile 'unit.report.${{ matrix.os }}-${{ matrix.go }}.json'
--
work
-race
-p 2
-count 1
-timeout=30m
-coverprofile='unit.coverage.${{ matrix.os }}-${{ matrix.go }}.out'
-covermode=atomic
-coverpkg='${{ needs.lint.outputs.coverpkg }}' ${EXTRA_FLAGS}
gotestsum \
--jsonfile 'unit.report.${{ matrix.os }}-${{ matrix.go }}.json' \
-- \
work \
"${RACEOPT}" \
-p 2 \
-count 1 \
-timeout="${TIMEOUT}" \
-coverprofile='unit.coverage.${{ matrix.os }}-${{ matrix.go }}.out' \
-covermode=atomic \
-coverpkg='${{ needs.lint.outputs.coverpkg }}' ${EXTRA_FLAGS} \
./...
-
name: Run unit tests on all modules (<go1.25 or no go.work) [monorepo]
Expand All @@ -183,17 +199,24 @@ jobs:
env:
EXTRA_FLAGS: ${{ inputs.extra-flags }}
ALL_MODULES: ${{ needs.lint.outputs.all-modules }}
run: >
gotestsum
--jsonfile 'unit.report.${{ matrix.os }}-${{ matrix.go }}.json'
--
-race
-p 2
-count 1
-timeout=30m
-coverprofile='unit.coverage.${{ matrix.os }}-${{ matrix.go }}.out'
-covermode=atomic
-coverpkg='${{ needs.lint.outputs.coverpkg }}' ${EXTRA_FLAGS}
WANTS_NORACE: ${{ inputs.no-race }}
TIMEOUT: ${{ inputs.timeout }}
run: |
RACEOPT="-race"
if [[ "${WANTS_NORACE}" == "true" ]] ; then
RACEOPT=""
fi

gotestsum \
--jsonfile 'unit.report.${{ matrix.os }}-${{ matrix.go }}.json' \
-- \
"${RACEOPT}" \
-p 2 \
-count 1 \
-timeout="${TIMEOUT}" \
-coverprofile='unit.coverage.${{ matrix.os }}-${{ matrix.go }}.out' \
-covermode=atomic \
-coverpkg='${{ needs.lint.outputs.coverpkg }}' ${EXTRA_FLAGS} \
${ALL_MODULES}
-
name: Run unit tests
Expand Down
39 changes: 28 additions & 11 deletions .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ on:

type: string
required: false
no-race:
description: 'runs test without -race'
type: string
required: false
default: 'false'
timeout:
description: 'test timeout'
type: string
required: false
default: '30m'

defaults:
run:
Expand Down Expand Up @@ -95,17 +105,24 @@ jobs:
name: Run unit tests
env:
EXTRA_FLAGS: ${{ inputs.extra-flags }}
run: >
gotestsum
--jsonfile 'unit.report.${{ matrix.os }}-${{ matrix.go }}.json'
--
-race
-p 2
-count 1
-timeout=30m
-coverprofile='unit.coverage.${{ matrix.os }}-${{ matrix.go }}.out'
-covermode=atomic
-coverpkg="$(go list)"/... ${EXTRA_FLAGS}
WANTS_NORACE: ${{ inputs.no-race }}
TIMEOUT: ${{ inputs.timeout }}
run: |
RACEOPT="-race"
if [[ "${WANTS_NORACE}" == "true" ]] ; then
RACEOPT=""
fi

gotestsum \
--jsonfile 'unit.report.${{ matrix.os }}-${{ matrix.go }}.json' \
-- \
"${RACEOPT}" \
-p 2 \
-count 1 \
-timeout="${TIMEOUT}" \
-coverprofile='unit.coverage.${{ matrix.os }}-${{ matrix.go }}.out' \
-covermode=atomic \
-coverpkg="$(go list)"/... ${EXTRA_FLAGS} \
./...
-
name: Upload coverage artifacts
Expand Down
Loading