Skip to content
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

wip: codecov 2 #5

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
47 changes: 47 additions & 0 deletions .github/workflows/codecov-upload.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: codecov-upload

on:
workflow_run:
workflows: ["gno.land", "tm2", "gnovm"]
types:
- completed

jobs:
upload:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- run: mkdir -p ${{ runner.temp }}/coverage

- name: Download coverage artifact from gnoland
uses: dawidd6/action-download-artifact@v2
with:
workflow: gnoland.yml
name: coverage-gnoland
path: ${{ runner.temp }}/coverage/gnoland
if_no_artifact_found: ignore

- name: Download coverage artifact from gnovm
uses: dawidd6/action-download-artifact@v2
with:
workflow: gnovm.yml
name: coverage-gnovm
path: ${{ runner.temp }}/coverage/gnovm
if_no_artifact_found: ignore

- name: Download coverage artifact from tm2
uses: dawidd6/action-download-artifact@v2
with:
workflow: tm2.yml
name: coverage-tm2
path: ${{ runner.temp }}/coverage/tm2
if_no_artifact_found: ignore

- name: Upload combined coverage to Codecov
uses: codecov/codecov-action@v3
with:
directory: ${{ runner.temp }}/coverage
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: ${{ github.repository == 'gnolang/gno' }}
31 changes: 17 additions & 14 deletions .github/workflows/gnoland.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,22 +74,25 @@ jobs:
export GOPATH=$HOME/go
export GOTEST_FLAGS="-v -p 1 -timeout=30m -coverprofile=coverage.out -covermode=atomic"
make ${{ matrix.args }}
- uses: actions/upload-artifact@v3
if: ${{ runner.os == 'Linux' && matrix.goversion == '1.21.x' }}
with:
name: ${{runner.os}}-coverage-gnoland-${{ matrix.args}}-${{matrix.goversion}}
path: ./gno.land/coverage.out

# NOTE: Using retry action to manage occasional upload failures to codecov.io, due to API limits.
# Refer to issue#3954: https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954
- if: ${{ runner.os == 'Linux' && matrix.goversion == '1.21.x' }}
name: Upload coverage to Codecov.io
uses: Wandalen/[email protected]
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:
attempt_limit: 3
attempt_delay: 30000
action: 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' }}
name: coverage-gnloand
path: ${{ runner.temp }}/coverage

docker-integration:
strategy:
Expand Down
33 changes: 18 additions & 15 deletions .github/workflows/gnovm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,23 @@ jobs:
export GOPATH=$HOME/go
export GOTEST_FLAGS="-v -p 1 -timeout=30m -coverprofile=coverage.out -covermode=atomic"
make ${{ matrix.args }}
- uses: actions/upload-artifact@v3
if: ${{ runner.os == 'Linux' && matrix.goversion == '1.21.x' }}
with:
name: ${{runner.os}}-coverage-gnovm-${{ matrix.args}}-${{matrix.goversion}}
path: ./gnovm/coverage.out

# NOTE: Using retry action to manage occasional upload failures to codecov.io, due to API limits.
# Refer to issue#3954: https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954
- if: ${{ runner.os == 'Linux' && matrix.goversion == '1.21.x' }}
name: Upload coverage to Codecov.io
uses: Wandalen/[email protected]
upload-coverage-artifact:
needs: test
runs-on: ubuntu-latest
steps:
- name: Download all previous coverage artifacts
uses: actions/download-artifact@v3
with:
attempt_limit: 3
attempt_delay: 30000
action: 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' }}
path: ${{ runner.temp }}/coverage
- name: Merge and re-upload to a single artifact
uses: actions/upload-artifact@v3
with:
name: coverage-gnovm
path: ${{ runner.temp }}/coverage

32 changes: 17 additions & 15 deletions .github/workflows/tm2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,22 @@ jobs:
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

# NOTE: Using retry action to manage occasional upload failures to codecov.io, due to API limits.
# Refer to issue#3954: https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954
- if: ${{ runner.os == 'Linux' && matrix.goversion == '1.21.x' }}
name: Upload coverage to Codecov.io
uses: Wandalen/[email protected]
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:
attempt_limit: 3
attempt_delay: 30000
action: codecov/codecov-action@v3
with: |
token: ${{ secrets.CODECOV_TOKEN }}
name: tm2
verbose: true
flags: tm2-${{matrix.args}}
files: ./tm2/coverage.out
fail_ci_if_error: ${{ github.repository == 'gnolang/gno' }}
name: coverage-tm2
path: ${{ runner.temp }}/coverage