Skip to content

Commit

Permalink
Defer coverage reports to the end of the CI pipeline
Browse files Browse the repository at this point in the history
Applies the new functionality in codecov/codecov-action#1436
to be able to defer reporting coverage until the entire pipeline
has uploaded coverage reports. This reduces noise in pull request
logs.
  • Loading branch information
ascopes committed Jan 26, 2025
1 parent 08f94f9 commit 80f5a0e
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 85 deletions.
72 changes: 0 additions & 72 deletions .github/workflows/build-ea.yml

This file was deleted.

35 changes: 34 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,33 @@ jobs:
- 11 # LTS
- 17 # LTS
- 21 # LTS
- GA # General access
include:
- os-name: ubuntu-latest
java-version: GA
- os-name: macos-latest
java-version: GA
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Initialize JDK
- name: Initialize Zulu JDK
if: matrix.java-version != 'GA'
uses: actions/setup-java@v4
with:
check-latest: true
distribution: zulu
java-version: ${{ matrix.java-version }}

- name: Initialize Oracle JDK
if: matrix.java-version == 'GA'
uses: oracle-actions/setup-java@v1
with:
website: jdk.java.net
release: ${{ matrix.java-version }}

- name: Maven cache
uses: actions/cache@v4
env:
Expand Down Expand Up @@ -66,3 +80,22 @@ jobs:
**/failsafe-reports/**
**/build*.log
retention-days: 30

notify-coverage:
name: Notify of coverage
runs-on: ubuntu-latest
timeout-minutes: 30
needs:
- build
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Publish code coverage
uses: codecov/codecov-action@v4
continue-on-error: true
if: always()
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
run_command: send-notifications
23 changes: 11 additions & 12 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,21 @@
#

# General behaviour.
coverage:
round: up
precision: 2

codecov:
branch: main
max_report_age: 12
notify:
# Notify via a separate pipeline step in CI once all builds have completed. This way, we don't
# report coverage after each parallel build completes, which results in spammy and incorrect
# email notifications and prematurely marking the build as having failed.
# https://github.com/codecov/codecov-action/issues/1436#issuecomment-2614065472
manual_trigger: true
require_ci_to_pass: true
strict_yaml_branch: main

# PR comment format.
comment:
layout: "reach, diff, flags, files"
behavior: default
require_changes: false
require_base: true
require_head: true

# Global coverage options.
coverage:
precision: 2
range: "10...100"
round: down
require_changes: true

0 comments on commit 80f5a0e

Please sign in to comment.