Skip to content

Commit c3e830c

Browse files
committed
fix(ci): Workflow test ouptputs + changes for codecov
1 parent 9790f02 commit c3e830c

File tree

5 files changed

+109
-39
lines changed

5 files changed

+109
-39
lines changed

.github/actions/backend-test/action.yml

+39-18
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,24 @@ runs:
1818
using: composite
1919
steps:
2020
- uses: actions/checkout@v4
21+
name: Checkout - Current ref
2122

2223
# Setup build
2324
- uses: kestra-io/actions/.github/actions/setup-build@main
25+
name: Setup - Build
2426
id: build
2527
with:
2628
java-enabled: true
2729
node-enabled: true
2830
python-enabled: true
2931

3032
# Services
31-
- name: Build the docker-compose stack
33+
- name: Setup - Start docker compose
3234
shell: bash
3335
run: docker compose -f docker-compose-ci.yml up -d
3436

3537
# Gradle check
36-
- name: Build with Gradle
38+
- name: Gradle - Build
3739
if: ${{ github.event.inputs.skip-test == 'false' || github.event.inputs.skip-test == '' }}
3840
env:
3941
GOOGLE_SERVICE_ACCOUNT: ${{ inputs.google-service-account }}
@@ -43,8 +45,20 @@ runs:
4345
export GOOGLE_APPLICATION_CREDENTIALS=$HOME/.gcp-service-account.json
4446
./gradlew check javadoc --parallel
4547
48+
# report test
49+
- name: Test - Publish Test Results
50+
uses: dorny/test-reporter@v1
51+
if: always()
52+
with:
53+
name: Java Tests Report
54+
reporter: java-junit
55+
path: '**/build/test-results/test/TEST-*.xml'
56+
list-suites: 'failed'
57+
list-tests: 'failed'
58+
fail-on-error: 'false'
59+
4660
# Sonar
47-
- name: Analyze with Sonar
61+
- name: Test - Analyze with Sonar
4862
if: ${{ inputs.sonar-token != '' }}
4963
env:
5064
GITHUB_TOKEN: ${{ inputs.github-token }}
@@ -53,16 +67,23 @@ runs:
5367
run: ./gradlew sonar --info
5468

5569
# Allure check
56-
- name: Auth to Google Cloud
70+
- name: GCP - Auth with unit test account
5771
id: auth
5872
if: ${{ always() && inputs.google-service-account != '' }}
73+
continue-on-error: true
5974
uses: "google-github-actions/auth@v2"
6075
with:
6176
credentials_json: "${{ inputs.google-service-account }}"
6277

78+
- name: GCP - Setup Cloud SDK
79+
if: ${{ inputs.google-service-account != '' }}
80+
uses: "google-github-actions/setup-gcloud@v2"
81+
82+
# Allure check
6383
- uses: rlespinasse/github-slug-action@v5
84+
name: Allure - Generate slug variables
6485

65-
- name: Publish allure report
86+
- name: Allure - Publish report
6687
uses: andrcuns/[email protected]
6788
if: ${{ always() && inputs.google-service-account != '' }}
6889
env:
@@ -78,26 +99,26 @@ runs:
7899
ignoreMissingResults: true
79100

80101
# Jacoco
81-
- name: "Set up Cloud SDK"
82-
if: ${{ inputs.google-service-account != '' }}
83-
uses: "google-github-actions/setup-gcloud@v2"
84-
85-
- name: "Copy jacoco files"
102+
- name: Jacoco - Copy reports
86103
if: ${{ inputs.google-service-account != '' }}
87104
shell: bash
88105
run: |
89106
mv build/reports/jacoco/testCodeCoverageReport build/reports/jacoco/test/
90107
mv build/reports/jacoco/test/testCodeCoverageReport.xml build/reports/jacoco/test/jacocoTestReport.xml
91108
gsutil -m rsync -d -r build/reports/jacoco/test/ gs://internal-kestra-host/${{ format('{0}/{1}', github.repository, 'jacoco') }}
109+
92110
93-
# report test
94-
- name: Test Report
95-
uses: mikepenz/action-junit-report@v5
96-
if: success() || failure()
111+
# Codecov
112+
- name: Codecov - Upload coverage reports
113+
uses: codecov/codecov-action@v5
114+
if: ${{ !cancelled() }}
115+
continue-on-error: true
97116
with:
98-
report_paths: "**/build/test-results/**/TEST-*.xml"
117+
token: ${{ inputs.codecov-token }}
99118

100-
# Codecov
101-
- uses: codecov/codecov-action@v5
119+
- name: Codecov - Upload test results
120+
uses: codecov/test-results-action@v1
121+
if: ${{ !cancelled() }}
122+
continue-on-error: true
102123
with:
103-
token: ${{ inputs.codecov-token }}
124+
token: ${{ inputs.codecov-token }}

.github/actions/build-artifacts/action.yml

+15-14
Original file line numberDiff line numberDiff line change
@@ -21,34 +21,35 @@ outputs:
2121
runs:
2222
using: composite
2323
steps:
24-
- name: Checkout current ref
24+
- name: Checkout - Current ref
2525
uses: actions/checkout@v4
2626
with:
2727
fetch-depth: 0
2828

2929
# Npm
30-
- name: Npm install
30+
- name: Setup - Npm install
3131
shell: bash
3232
working-directory: ui
3333
run: npm ci
3434

3535
# Setup build
3636
- uses: kestra-io/actions/.github/actions/setup-build@main
37+
name: Setup - Build
3738
id: build
3839
with:
3940
java-enabled: true
4041
node-enabled: true
4142

4243
# Get Plugins List
43-
- name: Get Plugins List
44+
- name: Plugins - Get List
4445
uses: ./.github/actions/plugins-list
4546
if: "!startsWith(github.ref, 'refs/tags/v')"
4647
id: plugins-list
4748
with:
4849
plugin-version: ${{ inputs.plugin-version }}
4950

5051
# Set Plugins List
51-
- name: Set Plugin List
52+
- name: Plugins - Set List
5253
id: plugins
5354
if: "!startsWith(github.ref, 'refs/tags/v')"
5455
shell: bash
@@ -62,18 +63,18 @@ runs:
6263
fi
6364
6465
# Build
65-
- name: Build with Gradle
66+
- name: Gradle - Build
6667
shell: bash
6768
run: |
6869
./gradlew executableJar
6970
70-
- name: Copy exe to image
71+
- name: Artifacts - Copy exe to image
7172
shell: bash
7273
run: |
7374
cp build/executable/* docker/app/kestra && chmod +x docker/app/kestra
7475
7576
# Docker Tag
76-
- name: Set up Vars
77+
- name: Setup - Docker vars
7778
id: vars
7879
shell: bash
7980
run: |
@@ -94,14 +95,14 @@ runs:
9495
echo "artifact=docker-kestra-${TAG}" >> $GITHUB_OUTPUT
9596
9697
# Docker setup
97-
- name: Set up QEMU
98+
- name: Docker - Setup QEMU
9899
uses: docker/setup-qemu-action@v3
99100

100-
- name: Set up Docker Buildx
101+
- name: Docker - Setup Buildx
101102
uses: docker/setup-buildx-action@v3
102103

103104
# Docker Build
104-
- name: Build & Export Docker Image
105+
- name: Docker - Build & export image
105106
uses: docker/build-push-action@v6
106107
if: "!startsWith(github.ref, 'refs/tags/v')"
107108
with:
@@ -117,26 +118,26 @@ runs:
117118
outputs: type=docker,dest=/tmp/${{ steps.vars.outputs.artifact }}.tar
118119

119120
# Upload artifacts
120-
- name: Upload JAR
121+
- name: Artifacts - Upload JAR
121122
uses: actions/upload-artifact@v4
122123
with:
123124
name: jar
124125
path: build/libs/
125126

126-
- name: Upload Executable
127+
- name: Artifacts - Upload Executable
127128
uses: actions/upload-artifact@v4
128129
with:
129130
name: exe
130131
path: build/executable/
131132

132-
- name: Upload Docker
133+
- name: Artifacts - Upload Docker
133134
uses: actions/upload-artifact@v4
134135
if: "!startsWith(github.ref, 'refs/tags/v')"
135136
with:
136137
name: ${{ steps.vars.outputs.artifact }}
137138
path: /tmp/${{ steps.vars.outputs.artifact }}.tar
138139

139-
- name: Set outputs
140+
- name: Output - Set outputs
140141
id: set-outputs
141142
shell: bash
142143
run: |

.github/actions/frontend-test/action.yml

+26-6
Original file line numberDiff line numberDiff line change
@@ -16,36 +16,39 @@ runs:
1616
with:
1717
ref: ${{ github.head_ref }}
1818

19-
- name: Npm install
19+
- name: Npm - install
2020
shell: bash
2121
working-directory: ui
2222
run: npm ci
2323

24-
- name: Npm lint
24+
- name: Npm - lint
2525
uses: reviewdog/action-eslint@v1
2626
with:
2727
github_token: ${{ inputs.github-token }}
2828
reporter: github-pr-review # Change reporter.
2929
workdir: "ui"
3030

31+
# Build to send bundle stats to codecov
3132
- name: Npm - Run build
3233
shell: bash
3334
working-directory: ui
3435
env:
3536
CODECOV_TOKEN: ${{ inputs.codecov-token }}
3637
run: npm run build
3738

39+
# Unit test
3840
- name: Run front-end unit tests
3941
shell: bash
4042
working-directory: ui
41-
run: npm run test:unit
43+
run: npm run test:cicd
4244

43-
- name: Install Playwright
45+
# Storybook
46+
- name: Storybook - Install Playwright
4447
shell: bash
4548
working-directory: ui
4649
run: npx playwright install --with-deps
4750

48-
- name: Build Storybook
51+
- name: Storybook - Build
4952
shell: bash
5053
working-directory: ui
5154
run: npm run build-storybook --quiet
@@ -56,4 +59,21 @@ runs:
5659
run: |
5760
npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \
5861
"npx http-server storybook-static --port 6006 --silent" \
59-
"npx wait-on tcp:127.0.0.1:6006 && npm run test:storybook"
62+
"npx wait-on tcp:127.0.0.1:6006 && npm run test:storybook"
63+
64+
# Codecov
65+
- name: Codecov - Upload coverage reports
66+
uses: codecov/codecov-action@v5
67+
if: ${{ !cancelled() }}
68+
continue-on-error: true
69+
with:
70+
token: ${{ secrets.CODECOV_TOKEN }}
71+
flags: frontend
72+
73+
- name: Codecov - Upload test results
74+
uses: codecov/test-results-action@v1
75+
if: ${{ !cancelled() }}
76+
continue-on-error: true
77+
with:
78+
token: ${{ inputs.codecov-token }}
79+
flags: frontend

.github/workflows/main.yml

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313
tests:
1414
name: Execute tests
1515
uses: ./.github/workflows/workflow-test.yml
16+
with:
17+
report-status: false
1618

1719
release:
1820
name: Release

.github/workflows/workflow-test.yml

+27-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,32 @@ name: Tests
22

33
on:
44
workflow_call:
5+
inputs:
6+
report-status:
7+
description: "Report status of the jobs"
8+
type: string
9+
required: false
10+
default: false
11+
outputs:
12+
docker-tag:
13+
description: "The Docker image Tag for Kestra"
14+
value: ${{ jobs.build-artifacts.outputs.docker-tag }}
15+
docker-artifact-name:
16+
description: "The GitHub artifact containing the Kestra docker image."
17+
value: ${{ jobs.build-artifacts.outputs.docker-artifact-name }}
18+
plugins:
19+
description: "The Kestra plugins used for the build."
20+
value: ${{ jobs.build-artifacts.outputs.plugins }}
21+
frontend_status:
22+
description: "Status of the frontend job"
23+
value: ${{ jobs.set-frontend-status.outputs.frontend_status }}
24+
backend_status:
25+
description: "Status of the backend job"
26+
value: ${{ jobs.set-backend-status.outputs.backend_status }}
27+
e2e_status:
28+
description: "Status of the e2e job"
29+
value: ${{ jobs.set-e2e-status.outputs.e2e_status }}
30+
531

632
jobs:
733
frontend:
@@ -75,7 +101,7 @@ jobs:
75101
- frontend
76102
- backend
77103
- e2e
78-
if: always()
104+
if: always() && inputs.report-status == 'true'
79105
outputs:
80106
frontend_status: ${{ steps.set-frontend-status.outputs.frontend_status }}
81107
backend_status: ${{ steps.set-backend-status.outputs.backend_status }}

0 commit comments

Comments
 (0)