mirror of
https://github.com/anyproto/anytype-heart.git
synced 2025-06-10 18:10:49 +09:00
Merge pull request #1381 from anyproto/go-3746-mw-ci-test-tuning
GO-3746 ci: disable race for tests in pull requests
This commit is contained in:
commit
29da0d8332
1 changed files with 13 additions and 3 deletions
16
.github/workflows/test.yml
vendored
16
.github/workflows/test.yml
vendored
|
@ -1,5 +1,10 @@
|
|||
on: [ pull_request ]
|
||||
name: Test
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
|
||||
|
@ -60,7 +65,12 @@ jobs:
|
|||
PACKAGE_NAMES=$(go list -tags nogrpcserver ./... | grep -v "github.com/anyproto/anytype-heart/cmd/grpserver" | grep -v "github.com/anyproto/anytype-heart/clientlibrary/clib")
|
||||
rm -rf ~/gotestsum-report
|
||||
mkdir ~/gotestsum-report
|
||||
CGO_CFLAGS="-Wno-deprecated-non-prototype -Wno-unknown-warning-option -Wno-deprecated-declarations -Wno-xor-used-as-pow -Wno-single-bit-bitfield-constant-conversion" gotestsum --junitfile ~/gotestsum-report/gotestsum-report.xml -- -tags "nogrpcserver nographviz" -ldflags="-extldflags=-Wl,-ld_classic" -p 1 $(echo $PACKAGE_NAMES) -race -coverprofile=coverage.out -covermode=atomic ./...
|
||||
if [[ "$GITHUB_REF" == "refs/heads/main" && "$GITHUB_EVENT_NAME" == "push" ]]; then
|
||||
export RACE=-race
|
||||
else
|
||||
echo "run without race detector"
|
||||
fi
|
||||
CGO_CFLAGS="-Wno-deprecated-non-prototype -Wno-unknown-warning-option -Wno-deprecated-declarations -Wno-xor-used-as-pow -Wno-single-bit-bitfield-constant-conversion" gotestsum --junitfile ~/gotestsum-report/gotestsum-report.xml -- -tags "nogrpcserver nographviz" -ldflags="-extldflags=-Wl,-ld_classic" -p 1 $(echo $PACKAGE_NAMES) $(echo $RACE) -coverprofile=coverage.out -covermode=atomic ./...
|
||||
|
||||
generated_pattern='^\/\/ Code generated .* DO NOT EDIT\.$'
|
||||
files_list=$(grep -rl "$generated_pattern" . | grep '\.go$' | sed 's/^\.\///')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue