Skip to content

Commit

Permalink
ci: update Unified CI configuration (#305)
Browse files Browse the repository at this point in the history
* update .github/workflows/go-test.yml

* update .github/workflows/go-check.yml

* ci: disable verbose logging in go-test

* ci: fix updating GITHUB_ENV in go-test

---------

Co-authored-by: web3-bot <web3-bot@users.noreply.github.com>
  • Loading branch information
galargh and web3-bot authored May 17, 2023
1 parent fb3abdd commit ff20a4d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
on:
pull_request:
push:
branches: ["main"]
branches: ["main","release"]
name: Go Checks

concurrency:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/go-test-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"verbose": false
}
24 changes: 17 additions & 7 deletions .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
on:
pull_request:
push:
branches: ["main"]
branches: ["main","release"]
name: Go Test

concurrency:
Expand All @@ -19,9 +19,9 @@ jobs:
os: [ "ubuntu", "windows", "macos" ]
go: ["1.19.x","1.20.x"]
env:
GOTESTFLAGS: -shuffle=on -cover -coverprofile=module-coverage.txt -coverpkg=./...
GO386FLAGS: -shuffle=on
GORACEFLAGS: -shuffle=on
GOTESTFLAGS: -cover -coverprofile=module-coverage.txt -coverpkg=./...
GO386FLAGS: ''
GORACEFLAGS: ''
runs-on: ${{ fromJSON(vars[format('UCI_GO_TEST_RUNNER_{0}', matrix.os)] || format('"{0}-latest"', matrix.os)) }}
name: ${{ matrix.os }} (go ${{ matrix.go }})
steps:
Expand All @@ -30,6 +30,16 @@ jobs:
submodules: recursive
- id: config
uses: protocol/.github/.github/actions/read-config@master
- if: toJSON(fromJSON(steps.config.outputs.json).shuffle) != 'false'
run: |
echo "GOTESTFLAGS=-shuffle=on $GOTESTFLAGS" >> $GITHUB_ENV
echo "GO386FLAGS=-shuffle=on $GO386FLAGS" >> $GITHUB_ENV
echo "GORACEFLAGS=-shuffle=on $GORACEFLAGS" >> $GITHUB_ENV
- if: toJSON(fromJSON(steps.config.outputs.json).verbose) != 'false'
run: |
echo "GOTESTFLAGS=-v $GOTESTFLAGS" >> $GITHUB_ENV
echo "GO386FLAGS=-v $GO386FLAGS" >> $GITHUB_ENV
echo "GORACEFLAGS=-v $GORACEFLAGS" >> $GITHUB_ENV
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
Expand All @@ -54,7 +64,7 @@ jobs:
env:
GOFLAGS: ${{ format('{0} {1}', env.GOTESTFLAGS, env.GOFLAGS) }}
with:
run: go test -v ./...
run: go test ./...
- name: Run tests (32 bit)
# can't run 32 bit tests on OSX.
if: matrix.os != 'macos' &&
Expand All @@ -67,7 +77,7 @@ jobs:
with:
run: |
export "PATH=$PATH_386:$PATH"
go test -v ./...
go test ./...
- name: Run tests with race detector
# speed things up. Windows and OSX VMs are slow
if: matrix.os == 'ubuntu' &&
Expand All @@ -76,7 +86,7 @@ jobs:
env:
GOFLAGS: ${{ format('{0} {1}', env.GORACEFLAGS, env.GOFLAGS) }}
with:
run: go test -v -race ./...
run: go test -race ./...
- name: Collect coverage files
id: coverages
shell: bash
Expand Down

0 comments on commit ff20a4d

Please sign in to comment.