diff --git a/.github/workflows/go-test.yml b/.github/workflows/go-test.yml index f729c6247f..a330325539 100644 --- a/.github/workflows/go-test.yml +++ b/.github/workflows/go-test.yml @@ -52,23 +52,32 @@ 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: @@ -76,6 +85,7 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Download modules + if: github.event_name != 'merge_group' run: go mod download - name: Determine coverage packages (PR) @@ -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 }} \ @@ -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 }} @@ -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' }} \ No newline at end of file