-
Notifications
You must be signed in to change notification settings - Fork 387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: tell codecov to wait_for_ci to avoid flappy reports #1160
Changes from all commits
a37ba6a
4416a4b
f2f708c
cfa1fae
db978bb
f749046
1e60225
1ccf42d
aa344d6
cd08a31
c3dbc92
968c04c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
go-version: | ||
goversion: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removing the dash to allow using the variable if |
||
- "1.20.x" | ||
- "1.21.x" | ||
tags: | ||
|
@@ -29,10 +29,12 @@ jobs: | |
- fsdb | ||
- boltdb | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
# golang | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
go-version: ${{ matrix.goversion }} | ||
|
||
# leveldb | ||
- name: install leveldb | ||
|
@@ -46,6 +48,5 @@ jobs: | |
sudo dpkg -i *.deb | ||
|
||
# test ./pkgs/db | ||
- uses: actions/checkout@v4 | ||
- name: test ./tm2/pkg/db | ||
run: go test -tags ${{ matrix.tags }} ./tm2/pkg/db/... |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,51 +21,51 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
go-version: | ||
goversion: | ||
- "1.20.x" | ||
- "1.21.x" | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. moving the actions/checkout before setup-go, because setup-go is trying to cache dependencies based on go.mod and go.sum |
||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- uses: actions/checkout@v4 | ||
go-version: ${{ matrix.goversion }} | ||
- run: go install -v ./gnovm/cmd/gno | ||
- run: go run ./gnovm/cmd/gno precompile --verbose ./examples | ||
- run: go run ./gnovm/cmd/gno build --verbose ./examples | ||
test: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
go-version: | ||
goversion: | ||
- "1.20.x" | ||
- "1.21.x" | ||
# unittests: TODO: matrix with contracts | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- uses: actions/checkout@v4 | ||
go-version: ${{ matrix.goversion }} | ||
- run: go install -v ./gnovm/cmd/gno | ||
- run: go run ./gnovm/cmd/gno test --verbose ./examples | ||
lint: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
go-version: | ||
goversion: | ||
- "1.20.x" | ||
- "1.21.x" | ||
# unittests: TODO: matrix with contracts | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- uses: actions/checkout@v4 | ||
go-version: ${{ matrix.goversion }} | ||
- run: go install -v ./gnovm/cmd/gno | ||
# testing official directories, basically examples/ minus examples/.../x/. | ||
- run: go run ./gnovm/cmd/gno lint --verbose ./examples/gno.land/p | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,12 @@ on: | |
- "tm2/**.go" | ||
- "gno.land/**" | ||
- ".github/workflows/gnovm.yml" | ||
# Until the codecov issue is resolved, it's essential to run the tests for gnovm, tm2, and gno.land concurrently. | ||
- "gnovm/**" | ||
- "tm2/**" | ||
- "gno.land/**" | ||
- "examples/**" | ||
- ".github/workflows/**" | ||
push: | ||
branches: [ "master" ] | ||
|
||
|
@@ -21,7 +27,7 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
go-version: | ||
goversion: | ||
- "1.20.x" | ||
- "1.21.x" | ||
goarch: [ "amd64" ] | ||
|
@@ -35,10 +41,10 @@ jobs: | |
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- uses: actions/checkout@v4 | ||
go-version: ${{ matrix.goversion }} | ||
- name: go install | ||
working-directory: gno.land | ||
run: GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go install ./cmd/${{ matrix.program }} | ||
|
@@ -47,7 +53,7 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
go-version: | ||
goversion: | ||
- "1.20.x" | ||
- "1.21.x" | ||
args: | ||
|
@@ -58,25 +64,24 @@ jobs: | |
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- uses: actions/checkout@v4 | ||
go-version: ${{ matrix.goversion }} | ||
- name: test | ||
working-directory: gno.land | ||
run: | | ||
export GOPATH=$HOME/go | ||
export GOTEST_FLAGS="-v -p 1 -timeout=30m -coverprofile=coverage.out -covermode=atomic" | ||
make ${{ matrix.args }} | ||
- if: runner.os == 'Linux' | ||
- if: ${{ runner.os == 'Linux' && matrix.goversion == '1.21.x' }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. to prevent inconsistent results, let's only upload the coverage of the latest supported version, while still unit testing with the previous version. |
||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
name: gno.land | ||
flags: gno.land-${{matrix.args}} | ||
files: ./gno.land/coverage.out | ||
#fail_ci_if_error: ${{ github.repository == 'gnolang/gno' }} | ||
fail_ci_if_error: false # temporarily | ||
fail_ci_if_error: ${{ github.repository == 'gnolang/gno' }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think this is what generated failed CI because of codecov 502 errors; would be nice to setup an auto-retry mechanism |
||
|
||
docker-integration: | ||
strategy: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,12 @@ on: | |
- "gnovm/Makefile" | ||
- "tm2/**.go" | ||
- ".github/workflows/gnovm.yml" | ||
# Until the codecov issue is resolved, it's essential to run the tests for gnovm, tm2, and gno.land concurrently. | ||
- "gnovm/**" | ||
- "tm2/**" | ||
- "gno.land/**" | ||
- "examples/**" | ||
- ".github/workflows/**" | ||
push: | ||
branches: [ "master" ] | ||
|
||
|
@@ -23,7 +29,7 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
go-version: # two latest versions | ||
goversion: # two latest versions | ||
- "1.20.x" | ||
- "1.21.x" | ||
goenv: # TODO: replace with pairs, so it's easier to read in the GH interface. | ||
|
@@ -34,10 +40,10 @@ jobs: | |
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- uses: actions/checkout@v4 | ||
go-version: ${{ matrix.goversion }} | ||
- name: go install | ||
working-directory: gnovm | ||
run: ${{ matrix.goenv }} go install ./cmd/${{ matrix.program }} | ||
|
@@ -46,7 +52,7 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
go-version: | ||
goversion: | ||
- "1.20.x" | ||
- "1.21.x" | ||
args: | ||
|
@@ -62,22 +68,22 @@ jobs: | |
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- uses: actions/checkout@v4 | ||
go-version: ${{ matrix.goversion }} | ||
- name: test | ||
working-directory: gnovm | ||
run: | | ||
export GOPATH=$HOME/go | ||
export GOTEST_FLAGS="-v -p 1 -timeout=30m -coverprofile=coverage.out -covermode=atomic" | ||
make ${{ matrix.args }} | ||
- if: runner.os == 'Linux' | ||
- if: ${{ runner.os == 'Linux' && matrix.goversion == '1.21.x' }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this might be a problem when we update go versions and 1.21 is not supported anymore, we can lose coverage execution. Maybe add go version to the flags? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, I'm the one who made the 3 last go version bumps and I basically made sure to update all the references I can find.
at some point, I was considering adding a variable.yml file with "latest_go" and "previous_go" variable; or maybe we can add a quick misc/check-go-versions.sh script to assist us or to check in the CI. |
||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
name: gnovm | ||
verbose: true | ||
flags: gnovm-${{matrix.args}} | ||
files: ./gnovm/coverage.out | ||
#fail_ci_if_error: ${{ github.repository == 'gnolang/gno' }} | ||
fail_ci_if_error: false # temporarily | ||
fail_ci_if_error: ${{ github.repository == 'gnolang/gno' }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the trick; making codecov wait for all jobs to finish before generating a report.