Skip to content

Commit 99e0349

Browse files
authored
Merge pull request #642 from aws/fabisev/codecov-both-archs
ci: Fix codecov project check on merge to main
2 parents fffd1b4 + 7934e0f commit 99e0349

3 files changed

Lines changed: 72 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: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,59 @@ 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+
permissions:
99+
contents: read
100+
strategy:
101+
fail-fast: false
102+
matrix:
103+
include:
104+
- arch: x86_64
105+
runner: ubuntu-latest
106+
- arch: aarch64
107+
runner: ubuntu-24.04-arm
108+
runs-on: ${{ matrix.runner }}
109+
name: "coverage (${{ matrix.arch }})"
110+
steps:
111+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
112+
113+
- name: Set up JDK 1.8
114+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
115+
with:
116+
java-version: 8
117+
distribution: corretto
118+
cache: maven
119+
120+
- name: Set up Docker Buildx
121+
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
122+
with:
123+
install: true
124+
125+
- name: Build and install core dependency locally
126+
working-directory: ./aws-lambda-java-core
127+
run: mvn clean install
128+
129+
- name: Build and install serialization dependency locally
130+
working-directory: ./aws-lambda-java-serialization
131+
run: mvn clean install
132+
133+
- name: Build Runtime Interface Client - Run 'build-${{ matrix.arch }}' target
134+
working-directory: ./aws-lambda-java-runtime-interface-client
135+
run: make build-${{ matrix.arch }}
136+
env:
137+
IS_JAVA_8: true
138+
92139
- name: Upload coverage to Codecov
93140
if: env.CODECOV_TOKEN != null
94141
uses: codecov/codecov-action@75cd11691c0faa626561e295848008c8a7dddffe # v5
142+
with:
143+
files: ./aws-lambda-java-runtime-interface-client/target/site/jacoco/jacoco.xml
144+
flags: ${{ matrix.arch }}
145+
disable_search: true
95146
env:
96147
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)