Skip to content
Merged
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
20 changes: 15 additions & 5 deletions .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,30 +52,40 @@ jobs:

coverage:
name: Coverage
runs-on: uci-default
runs-on: ${{ github.event_name == 'merge_group' && 'ubuntu-latest' || 'uci-default' }}
# Skip coverage report for merge groups, since the queue is about safety check. The merge to main will run coverage anyway.
# GitHub does not support setting "Required" CI workflows for merge queue separately from PRs. If we skip the job at top
# level we then have to work around result not being present. Hence, the repeated if statements per step.
env:
GOFLAGS: -tags=ledger,test_ledger_mock
steps:
- name: Check trigger
if: github.event_name == 'merge_group'
run: echo 'Coverage skipped in merge queue'

- uses: actions/checkout@v5
if: github.event_name != 'merge_group'
with:
# Depth 0 for PRs so merge-base diff against the base branch works.
fetch-depth: ${{ github.event_name == 'pull_request' && '0' || '1' }}

- uses: actions/setup-go@v6
if: github.event_name != 'merge_group'
with:
go-version: ${{ env.GO_VERSION }}
cache: false

- name: Login to Docker Hub
uses: docker/login-action@v3
if: env.DOCKERHUB_USERNAME != ''
if: github.event_name != 'merge_group' && env.DOCKERHUB_USERNAME != ''
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Download modules
if: github.event_name != 'merge_group'
run: go mod download

- name: Determine coverage packages (PR)
Expand Down Expand Up @@ -153,7 +163,7 @@ jobs:
${{ steps.cov-pkgs.outputs.test_packages }}

- name: Go test with coverage (full path)
if: github.event_name != 'pull_request'
if: github.event_name != 'merge_group' && github.event_name != 'pull_request'
run: |
go test \
-timeout=${{ env.GO_TEST_TIMEOUT }} \
Expand All @@ -163,7 +173,7 @@ jobs:
./...

- name: Upload coverage to Codecov
if: github.event_name != 'pull_request' || steps.cov-pkgs.outputs.skip != 'true'
if: github.event_name != 'merge_group' && (github.event_name != 'pull_request' || steps.cov-pkgs.outputs.skip != 'true')
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand All @@ -174,4 +184,4 @@ jobs:
# Upload under a separate flag to avoid apples-to-oranges project comparisons.
name: ${{ github.event_name == 'pull_request' && 'sei-chain-pr-coverage' || 'sei-chain-coverage' }}
files: ./coverage.out
flags: ${{ github.event_name == 'pull_request' && 'sei-chain-pr' || 'sei-chain' }}
flags: ${{ github.event_name == 'pull_request' && 'sei-chain-pr' || 'sei-chain' }}
Loading