Skip to content

Commit 9ac6b5a

Browse files
authored
Set commit parent for codecov coverage/test report comparison (#1304)
* Set commit parent for codecov coverage/test report comparison * Fixed sytax in test suit github workflow * Updated testsuite workflow * More syntax fixes to testsuite workflow
1 parent ae423c0 commit 9ac6b5a

File tree

2 files changed

+101
-0
lines changed

2 files changed

+101
-0
lines changed

.codecov.yaml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
flag_management:
2+
individual_flags:
3+
- name: etl
4+
paths:
5+
- src/core
6+
- name: cli
7+
paths:
8+
- src/cli
9+
- name: lib-array-dot
10+
paths:
11+
- src/lib/array-dot
12+
- name: lib-azure-sdk
13+
paths:
14+
- src/lib/azure-sdk
15+
- name: lib-doctrine-dbal-bulk
16+
paths:
17+
- src/lib/doctrine-dbal-bulk
18+
- name: lib-filesystem
19+
paths:
20+
- src/lib/filesystem
21+
- name: lib-parquet
22+
paths:
23+
- src/lib/parquet
24+
- name: lib-parquet-viewer
25+
paths:
26+
- src/lib/parquet-viewer
27+
- name: lib-rdsl
28+
paths:
29+
- src/lib/rdsl
30+
- name: lib-snappy
31+
paths:
32+
- src/lib/snappy
33+
- name: bridge-filesystem-async-aws
34+
paths:
35+
- src/bridge/filesystem/async-aws
36+
- name: bridge-filesystem-azure
37+
paths:
38+
- src/bridge/filesystem/azure
39+
- name: bridge-monolog-http
40+
paths:
41+
- src/bridge/monolog/http
42+
- name: symfony-http-foundation
43+
paths:
44+
- src/bridge/symfony/http-foundation
45+
- name: adapter-chartjs
46+
paths:
47+
- src/adapter/etl-adapter-chartjs
48+
- name: adapter-csv
49+
paths:
50+
- src/adapter/etl-adapter-csv
51+
- name: adapter-doctrine
52+
paths:
53+
- src/adapter/etl-adapter-doctrine
54+
- name: adapter-elasticsearch
55+
paths:
56+
- src/adapter/etl-adapter-elasticsearch
57+
- name: adapter-google-sheet
58+
paths:
59+
- src/adapter/etl-adapter-google-sheet
60+
- name: adapter-http
61+
paths:
62+
- src/adapter/etl-adapter-http
63+
- name: adapter-json
64+
paths:
65+
- src/adapter/etl-adapter-json
66+
- name: adapter-logger
67+
paths:
68+
- src/adapter/etl-adapter-logger
69+
- name: adapter-meilisearch
70+
paths:
71+
- src/adapter/etl-adapter-meilisearch
72+
- name: adapter-parquet
73+
paths:
74+
- src/adapter/etl-adapter-parquet
75+
- name: adapter-text
76+
paths:
77+
- src/adapter/etl-adapter-text
78+
- name: adapter-xml
79+
paths:
80+
- src/adapter/etl-adapter-xml

.github/workflows/test-suite.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,19 +249,40 @@ jobs:
249249
- name: "Test - Examples"
250250
run: "composer test:examples"
251251

252+
- name: Get the source branch of the PR
253+
if: ${{ matrix.php-version == '8.2' && matrix.dependencies == 'locked' }}
254+
run: |
255+
pr_source_branch=${{ github.event.pull_request.head.ref }}
256+
echo "Source branch of the PR: $pr_source_branch"
257+
echo "pr_source_branch=$pr_source_branch" >> $GITHUB_ENV
258+
259+
- name: Download artifact
260+
if: ${{ matrix.php-version == '8.2' && matrix.dependencies == 'locked' }}
261+
uses: actions/download-artifact@v3
262+
with:
263+
name: "codecov-base-commit-sha-${{ env.pr_source_branch }}"
264+
265+
- name: Read artifact content into variable
266+
if: ${{ matrix.php-version == '8.2' && matrix.dependencies == 'locked' }}
267+
run: |
268+
ARTIFACT_CONTENT=$(cat codecov-base-commit-sha-${{ env.pr_source_branch }}) # Read artifact content
269+
echo "codecov_base_commit_sha=$ARTIFACT_CONTENT" >> $GITHUB_ENV
270+
252271
- name: Upload test results to Codecov.io
253272
if: ${{ !cancelled() && matrix.php-version == '8.2' && matrix.dependencies == 'locked' }}
254273
uses: codecov/test-results-action@v1
255274
with:
256275
token: ${{ secrets.CODECOV_TOKEN }}
257276
directory: ./var/phpunit/logs
277+
commit_parent: ${{ env.codecov_base_commit_sha }}
258278

259279
- name: Upload code coverage data to Codecov.io
260280
if: ${{ !cancelled() && matrix.php-version == '8.2' && matrix.dependencies == 'locked' }}
261281
uses: codecov/codecov-action@v4
262282
with:
263283
token: ${{ secrets.CODECOV_TOKEN }}
264284
directory: ./var/phpunit/coverage/clover
285+
commit_parent: ${{ env.codecov_base_commit_sha }}
265286

266287
- name: Get the branch name and SHA
267288
if: ${{ github.event_name == 'push' && matrix.php-version == '8.2' && matrix.dependencies == 'locked' }}

0 commit comments

Comments
 (0)