Skip to content

Commit df7e89a

Browse files
Taskl/test multiple branches (#57)
* task: merge trustify-tests repository Signed-off-by: Carlos Feria <2582866+carlosthe19916@users.noreply.github.com> * rebase main Signed-off-by: Carlos Feria <2582866+carlosthe19916@users.noreply.github.com> * align playwright server and client versions Signed-off-by: Carlos Feria <2582866+carlosthe19916@users.noreply.github.com> * ci: enable e2e tests in multiple branches Signed-off-by: Carlos Feria <2582866+carlosthe19916@users.noreply.github.com> * fix branch extraction logic --------- Signed-off-by: Carlos Feria <2582866+carlosthe19916@users.noreply.github.com>
1 parent 3dbe513 commit df7e89a

File tree

5 files changed

+42
-8
lines changed

5 files changed

+42
-8
lines changed

.github/workflows/ci-coverage.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
merge_group:
1212

1313
concurrency:
14-
group: ci-coverage-global-${{ github.ref }}
14+
group: ci-coverage-e2e-${{ github.ref }}
1515
cancel-in-progress: true
1616

1717
jobs:

.github/workflows/ci-e2e-template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Run global Trustify CI tests
1+
name: Run e2e Trustify CI tests
22

33
on:
44
workflow_call:

.github/workflows/ci-e2e.yaml

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,20 @@ on:
44
push:
55
branches:
66
- "main"
7+
- "release/*"
78
pull_request:
89
branches:
910
- "main"
11+
- "release/*"
1012
workflow_call:
1113
merge_group:
1214

1315
concurrency:
14-
group: ci-global-${{ github.ref }}
16+
group: ci-e2e-${{ github.ref }}
1517
cancel-in-progress: true
1618

1719
jobs:
18-
build-and-upload-for-global-ci:
20+
build-and-upload-for-e2e-ci:
1921
runs-on: ubuntu-latest
2022
steps:
2123
- uses: actions/checkout@v5
@@ -32,9 +34,41 @@ jobs:
3234
path: /tmp/trustify-ui.tar
3335
retention-days: 1
3436

37+
discover-envs-for-e2e-ci:
38+
runs-on: ubuntu-latest
39+
outputs:
40+
image_tag: ${{ steps.set-outputs.outputs.image_tag }}
41+
steps:
42+
- name: Extract env vars for main
43+
shell: bash
44+
if: ${{ (github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'main') || (github.event_name != 'pull_request' && github.ref == 'refs/heads/main') }}
45+
run: |
46+
echo "image_tag=latest" >> $GITHUB_ENV
47+
- name: Extract env vars for other branches on PR
48+
shell: bash
49+
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref != 'main' }}
50+
run: |
51+
branch=${{ github.event.pull_request.base.ref }}
52+
branch_version="${branch#release/}"
53+
echo "image_tag=$branch_version" >> $GITHUB_ENV
54+
- name: Extract env vars for other branches on Push
55+
shell: bash
56+
if: ${{ github.event_name != 'pull_request' && contains(github.ref, 'refs/heads/main') == false }}
57+
run: |
58+
branch=$(echo ${GITHUB_REF#refs/heads/})
59+
branch_version="${branch#release/}"
60+
echo "image_tag=$branch_version" >> $GITHUB_ENV
61+
- name: Set outputs
62+
id: set-outputs
63+
run: |
64+
echo "image_tag=${{ env.image_tag }}" >> "$GITHUB_OUTPUT"
65+
3566
run-e2e-ci:
36-
needs: build-and-upload-for-global-ci
67+
needs:
68+
- build-and-upload-for-e2e-ci
69+
- discover-envs-for-e2e-ci
3770
uses: ./.github/workflows/ci-e2e-template.yaml
3871
with:
3972
artifact: trustify-ui
4073
ui_image: ghcr.io/trustification/trustify-ui:pr-test
74+
server_image: ghcr.io/trustification/trustd:${{ needs.discover-envs-for-e2e-ci.outputs.image_tag }}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Nightly CI (global trustify CI @main)
1+
name: Nightly CI (e2e trustify CI @main)
22

33
on:
44
schedule:
@@ -8,4 +8,4 @@ on:
88

99
jobs:
1010
nightly:
11-
uses: ./.github/workflows/ci-global.yaml
11+
uses: ./.github/workflows/ci-e2e.yaml

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Trustify UI Component
1212

1313
| branch | last merge e2e CI | nightly e2e CI |
1414
| :----- | :---------------- | :------------- |
15-
| main | [![CI (global Trustify CI)](https://github.com/trustification/trustify-ui/actions/workflows/ci-global.yaml/badge.svg?branch=main&event=push)](https://github.com/trustification/trustify-ui/actions/workflows/ci-global.yaml?query=branch%3Amain+event%3Apush) | [![Nightly CI (global trustify CI @main)](https://github.com/trustification/trustify-ui/actions/workflows/nightly-ci-global.yaml/badge.svg?branch=main&event=schedule)](https://github.com/trustification/trustify-ui/actions/workflows/nightly-ci-global.yaml?query=branch%3Amain+event%3Aschedule) |
15+
| main | [![CI (e2e Trustify CI)](https://github.com/trustification/trustify-ui/actions/workflows/ci-e2e.yaml/badge.svg?branch=main&event=push)](https://github.com/trustification/trustify-ui/actions/workflows/ci-e2e.yaml?query=branch%3Amain+event%3Apush) | [![Nightly CI (e2e trustify CI @main)](https://github.com/trustification/trustify-ui/actions/workflows/nightly-ci-e2e.yaml/badge.svg?branch=main&event=schedule)](https://github.com/trustification/trustify-ui/actions/workflows/nightly-ci-e2e.yaml?query=branch%3Amain+event%3Aschedule) |
1616

1717
## Development
1818

0 commit comments

Comments
 (0)