wip: codecov 2 #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: tm2 | |
on: | |
pull_request: | |
paths: | |
- "go.sum" | |
- "tm2/Makefile" | |
- "tm2/**.go" | |
- ".github/workflows/tm2.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" ] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
goversion: | |
- "1.20.x" | |
- "1.21.x" | |
goarch: [ "amd64" ] | |
goos: [ "linux" ] | |
program: [ "./pkg/amino/cmd/aminoscan", "./pkg/amino/cmd/goscan", "./pkg/autofile/cmd", "./pkg/iavl/cmd/iaviewer" ] | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.goversion }} | |
- name: go install | |
working-directory: tm2 | |
run: GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go install ${{ matrix.program }} | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
goversion: | |
- "1.20.x" | |
- "1.21.x" | |
args: | |
- _test.flappy | |
- _test.pkg.amino | |
- _test.pkg.bft | |
- _test.pkg.others | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.goversion }} | |
- name: test | |
working-directory: tm2 | |
run: | | |
export GOPATH=$HOME/go | |
export GOTEST_FLAGS="-v -p 1 -timeout=30m -coverprofile=coverage.out -covermode=atomic" | |
make ${{ matrix.args }} | |
touch coverage.out | |
- uses: actions/upload-artifact@v3 | |
if: ${{ runner.os == 'Linux' && matrix.goversion == '1.21.x' }} | |
with: | |
name: ${{runner.os}}-coverage-tm2-${{ matrix.args}}-${{matrix.goversion}} | |
path: ./tm2/coverage.out | |
upload-coverage-artifact: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download all previous coverage artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: ${{ runner.temp }}/coverage | |
- name: Merge and re-upload to a single artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage-tm2 | |
path: ${{ runner.temp }}/coverage |