Skip to content

Commit bf86c36

Browse files
author
Fabiana Severin
committed
ci: Fix codecov project check on merge to main
1 parent fffd1b4 commit bf86c36

3 files changed

Lines changed: 70 additions & 0 deletions

File tree

.codecov.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Codecov config. Coverage comes from the RIC package (JaCoCo), measured on x86_64 and aarch64.
2+
#
3+
# threshold 1%: PRs upload the union of both archs while merges to main can land a
4+
# single-arch report, so identical code can differ <1%. The tolerance avoids failing
5+
# merges on that measurement noise. patch is off; project coverage is the gate.
6+
# carryforward keeps a flag's last value when a commit doesn't re-upload it.
7+
coverage:
8+
status:
9+
project:
10+
default:
11+
target: auto
12+
threshold: 1%
13+
patch: off
14+
15+
flag_management:
16+
default_rules:
17+
carryforward: true

.github/workflows/runtime-interface-client_merge_to_main.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,57 @@ jobs:
8989
ENABLE_SNAPSHOT: ${{ secrets.ENABLE_SNAPSHOT }}
9090
run: make publish
9191

92+
# Coverage is measured on both native architectures (x86_64 and aarch64) so
93+
# the coverage recorded for a merge to main matches what the PR build recorded
94+
# (the union of both archs). Uploading a single x86_64 report here previously
95+
# made every merge commit look ~0.4% lower than its own PR base, failing the
96+
# codecov/project status on identical code.
97+
coverage:
98+
strategy:
99+
fail-fast: false
100+
matrix:
101+
include:
102+
- arch: x86_64
103+
runner: ubuntu-latest
104+
- arch: aarch64
105+
runner: ubuntu-24.04-arm
106+
runs-on: ${{ matrix.runner }}
107+
name: "coverage (${{ matrix.arch }})"
108+
steps:
109+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
110+
111+
- name: Set up JDK 1.8
112+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
113+
with:
114+
java-version: 8
115+
distribution: corretto
116+
cache: maven
117+
118+
- name: Set up Docker Buildx
119+
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
120+
with:
121+
install: true
122+
123+
- name: Build and install core dependency locally
124+
working-directory: ./aws-lambda-java-core
125+
run: mvn clean install
126+
127+
- name: Build and install serialization dependency locally
128+
working-directory: ./aws-lambda-java-serialization
129+
run: mvn clean install
130+
131+
- name: Build Runtime Interface Client - Run 'build-${{ matrix.arch }}' target
132+
working-directory: ./aws-lambda-java-runtime-interface-client
133+
run: make build-${{ matrix.arch }}
134+
env:
135+
IS_JAVA_8: true
136+
92137
- name: Upload coverage to Codecov
93138
if: env.CODECOV_TOKEN != null
94139
uses: codecov/codecov-action@75cd11691c0faa626561e295848008c8a7dddffe # v5
140+
with:
141+
files: ./aws-lambda-java-runtime-interface-client/target/site/jacoco/jacoco.xml
142+
flags: ${{ matrix.arch }}
143+
disable_search: true
95144
env:
96145
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/runtime-interface-client_pr.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ jobs:
9999
- name: Upload coverage to Codecov
100100
if: env.CODECOV_TOKEN != null
101101
uses: codecov/codecov-action@75cd11691c0faa626561e295848008c8a7dddffe # v5
102+
with:
103+
files: ./aws-lambda-java-runtime-interface-client/target/site/jacoco/jacoco.xml
104+
flags: ${{ matrix.arch }}
105+
disable_search: true
102106
env:
103107
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
104108

0 commit comments

Comments
 (0)