Skip to content

Commit 0cc8ca4

Browse files
authored
Merge pull request #192 from shawn-hurley/add-e2e-workflow
Add e2e workflow
2 parents 368e6ff + 35e17cc commit 0cc8ca4

16 files changed

Lines changed: 1917 additions & 93 deletions

.github/workflows/build-nightly-images.yaml

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ on:
1111
description: 'Branch to build from'
1212
required: true
1313
type: string
14+
tag:
15+
description: 'the tag to be used for the built image'
16+
required: false
17+
type: string
18+
tested_repo:
19+
description: |
20+
The repository being tested (e.g., "konveyor/analyzer-lsp").
21+
Used to determine which repo should use the PR/branch ref vs base ref.
22+
If not provided, all repos use the branch ref.
23+
required: false
24+
type: string
1425
outputs:
1526
dependent-jobs:
1627
description: 'Dependent jobs to build next'
@@ -31,13 +42,12 @@ jobs:
3142
uses: actions/checkout@v5
3243
with:
3344
repository: ${{ matrix.image.repo }}
34-
ref: ${{ inputs.branch }}
3545

3646
- name: Setup golang
3747
uses: actions/setup-go@v6
3848
with:
3949
go-version: '1.25'
40-
50+
4151
- name: Update go mod to the branch
4252
id: go_mod
4353
shell: bash
@@ -57,14 +67,23 @@ jobs:
5767
# Run go mod tidy to clean up
5868
go mod tidy
5969
60-
- name: Get Nightly Tag
70+
- name: Get Tag
6171
id: get_tag
6272
shell: bash
73+
env:
74+
INPUT_TAG: ${{ inputs.tag }}
6375
run: |
64-
date=$(date +'%Y.%m.%d')
65-
date+="_${{ matrix.os.arch }}"
66-
echo "tag=${{ inputs.branch }}_$date" >> $GITHUB_OUTPUT
76+
77+
if [ -n "$INPUT_TAG" ]; then
78+
INPUT_TAG+="_${{ matrix.os.arch }}"
79+
echo "tag=$INPUT_TAG" >> $GITHUB_OUTPUT
80+
else
81+
date=$(date +'%Y.%m.%d')
82+
date+="_${{ matrix.os.arch }}"
83+
echo "tag=${{ inputs.branch }}_$date" >> $GITHUB_OUTPUT
84+
fi
6785
86+
6887
- name: build image
6988
id: build-image
7089
uses: konveyor/ci/build-image@main
@@ -78,6 +97,7 @@ jobs:
7897
build_args: ${{ matrix.image.args }}
7998
checked_out: true
8099
base_image: ${{ matrix.image.base_image }}
100+
base_image_arg: ${{ matrix.image.base_image_arg }}
81101

82102

83103
build-manifest-lists:
@@ -88,16 +108,22 @@ jobs:
88108
matrix:
89109
image: ${{ fromJSON(inputs.matrix-config).image }}
90110
steps:
91-
- name: Get Nightly Tag
111+
- name: Get Tag
92112
id: get_tag
93113
shell: bash
114+
env:
115+
INPUT_TAG: ${{ inputs.tag }}
94116
run: |
95-
date=$(date +'%Y.%m.%d')
96-
echo "tag=${{ inputs.branch }}_$date" >> $GITHUB_OUTPUT
117+
if [ -n "$INPUT_TAG" ]; then
118+
NEW_TAG="$INPUT_TAG"
119+
else
120+
date=$(date +'%Y.%m.%d')
121+
NEW_TAG="${{ inputs.branch }}_$date"
122+
fi
123+
echo "tag=$NEW_TAG" >> $GITHUB_OUTPUT
97124
IMAGE_NAME="${{ matrix.image.image }}"
98-
date+="_{amd64,arm64}"
99-
IMAGE_TAG="${{ inputs.branch }}_$date"
100-
FILE_NAME="${IMAGE_NAME//\//_}--${IMAGE_TAG//\//_}"
125+
NEW_TAG+="_{amd64,arm64}"
126+
FILE_NAME="${IMAGE_NAME//\//_}--${NEW_TAG//\//_}"
101127
echo "download_pattern=$FILE_NAME" >> $GITHUB_OUTPUT
102128
103129
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Run Koncur with tackle-hub config e2e
2+
3+
on:
4+
workflow_call:
5+
# There should be no need to pass in anything as we should have all we need
6+
# based on the github context
7+
workflow_dispatch:
8+
inputs:
9+
repo:
10+
description: |
11+
This is the repo to simulate the testing from.
12+
ref:
13+
description: |
14+
The ref that should be tested from. Could be a branch or PR. that should be used to pull all konveyor related repos.
15+
For example, if you wanted to set a nightly build for release-0.8, you would specify
16+
"release-0.8".
17+
required: false
18+
type: string
19+
default: main
20+
21+
jobs:
22+
23+
build-images:
24+
uses: ./.github/workflows/e2e-image-build.yaml
25+
with:
26+
repo: ${{ inputs.repo || github.repository }}
27+
ref: ${{ inputs.ref || github.ref }}
28+
secrets: inherit
29+
30+
run-koncur-action:
31+
runs-on: ubuntu-latest
32+
needs: build-images
33+
steps:
34+
- name: Run Koncur Testing
35+
uses: konveyor/ci/koncur-tackle-hub@main
36+
with:
37+
image_pattern: |
38+
*{tackle-keycloak-init,tackle2-*,provider}--${{ github.run_id }}
39+
ref: ${{ github.base_ref || inputs.ref || github.ref_name}}
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
name: e2e Testing Image Build
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
# There should be no need to pass in anything as we should have all we need
7+
# based on the github context
8+
repo:
9+
description: |
10+
This is the repo to simulate the testing from.
11+
required: true
12+
type: string
13+
ref:
14+
description: |
15+
The ref that should be tested from. Could be a branch or PR. that should be used to pull all konveyor related repos.
16+
For example, if you wanted to set a nightly build for release-0.8, you would specify
17+
"release-0.8".
18+
required: true
19+
type: string
20+
tag:
21+
description: |
22+
The tag to use for the images
23+
required: false
24+
type: string
25+
workflow_dispatch:
26+
inputs:
27+
repo:
28+
description: |
29+
This is the repo to simulate the testing from.
30+
required: false
31+
type: string
32+
ref:
33+
description: |
34+
The ref that should be tested from. Could be a branch or PR. that should be used to pull all konveyor related repos.
35+
For example, if you wanted to set a nightly build for release-0.8, you would specify
36+
"release-0.8".
37+
required: false
38+
type: string
39+
tag:
40+
description: |
41+
The tag to use for the images
42+
required: false
43+
type: string
44+
45+
jobs:
46+
prepare-matrix:
47+
runs-on: ubuntu-latest
48+
outputs:
49+
matrix_0: ${{ steps.prepare.outputs.matrix_0 }}
50+
matrix_1: ${{ steps.prepare.outputs.matrix_1 }}
51+
matrix_2: ${{ steps.prepare.outputs.matrix_2 }}
52+
matrix_3: ${{ steps.prepare.outputs.matrix_3 }}
53+
steps:
54+
## For now, just using main, but in the future we probably want this to
55+
# use the same ref that the workflow is being called at. I don't know
56+
# how to get that information right now
57+
- name: Checkout ci repo
58+
uses: actions/checkout@v5
59+
with:
60+
repository: konveyor/ci
61+
ref: 'main'
62+
63+
- name: Setup Python
64+
uses: actions/setup-python@v6
65+
with:
66+
python-version: '3.12'
67+
68+
- name: Prepare matrix configs
69+
id: prepare
70+
shell: bash
71+
run: |
72+
73+
pip install -r scripts/requirements.txt
74+
python scripts/parse_matrix_config.py .github/workflows/nightly-matrix-config.yaml -t ${{ inputs.tag || github.run_id }} -b ${{ github.base_ref || github.ref_name }} -r ${{ inputs.repo || github.repository }} out
75+
76+
# The output may be one ore more of these, we should handle the case where these are empty.
77+
matrix_0=$(cat out/level_0.json)
78+
matrix_1=$(cat out/level_1.json)
79+
matrix_2=$(cat out/level_2.json)
80+
matrix_3=$(cat out/level_3.json)
81+
82+
{
83+
echo "matrix_0<<EOF"
84+
echo "$matrix_0"
85+
echo "EOF"
86+
} >> $GITHUB_OUTPUT
87+
{
88+
echo "matrix_1<<EOF"
89+
echo "$matrix_1"
90+
echo "EOF"
91+
} >> $GITHUB_OUTPUT
92+
{
93+
echo "matrix_2<<EOF"
94+
echo "$matrix_2"
95+
echo "EOF"
96+
} >> $GITHUB_OUTPUT
97+
{
98+
echo "matrix_3<<EOF"
99+
echo "$matrix_3"
100+
echo "EOF"
101+
} >> $GITHUB_OUTPUT
102+
103+
build-images:
104+
name: "Build level 0 images"
105+
if: ${{ fromJSON(needs.prepare-matrix.outputs.matrix_0).image[0] != null }}
106+
needs: prepare-matrix
107+
uses: ./.github/workflows/build-nightly-images.yaml
108+
with:
109+
matrix-config: ${{ needs.prepare-matrix.outputs.matrix_0 }}
110+
branch: ${{ inputs.ref || github.ref }}
111+
tag: ${{ inputs.tag || github.run_id }}
112+
tested_repo: ${{ inputs.repo || github.repository }}
113+
114+
build-level1-images:
115+
name: "Build level 1 images"
116+
if: ${{ !failure() && fromJSON(needs.prepare-matrix.outputs.matrix_1).image[0] != null }}
117+
needs:
118+
- prepare-matrix
119+
- build-images
120+
uses: ./.github/workflows/build-nightly-images.yaml
121+
with:
122+
matrix-config: ${{ needs.prepare-matrix.outputs.matrix_1 }}
123+
branch: ${{ inputs.ref || github.ref }}
124+
tag: ${{ inputs.tag || github.run_id }}
125+
tested_repo: ${{ inputs.repo || github.repository }}
126+
127+
build-level2-images:
128+
name: "Build level 2 images"
129+
if: ${{ !failure() && fromJSON(needs.prepare-matrix.outputs.matrix_2).image[0] != null }}
130+
needs:
131+
- prepare-matrix
132+
- build-level1-images
133+
uses: ./.github/workflows/build-nightly-images.yaml
134+
with:
135+
matrix-config: ${{ needs.prepare-matrix.outputs.matrix_2 }}
136+
branch: ${{ inputs.ref || github.ref }}
137+
tag: ${{ inputs.tag || github.run_id }}
138+
tested_repo: ${{ inputs.repo || github.repository }}
139+
140+
build-level3-images:
141+
name: "Build level 3 images"
142+
if: ${{ !failure() && fromJSON(needs.prepare-matrix.outputs.matrix_3).image[0] != null }}
143+
needs:
144+
- prepare-matrix
145+
- build-level2-images
146+
uses: ./.github/workflows/build-nightly-images.yaml
147+
with:
148+
matrix-config: ${{ needs.prepare-matrix.outputs.matrix_3 }}
149+
branch: ${{ inputs.ref || github.ref }}
150+
tag: ${{ inputs.tag || github.run_id }}
151+
tested_repo: ${{ inputs.repo || github.repository }}
152+
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Run Koncur with kantra config e2e
2+
3+
on:
4+
workflow_call:
5+
# There should be no need to pass in anything as we should have all we need
6+
# based on the github context
7+
workflow_dispatch:
8+
inputs:
9+
repo:
10+
description: |
11+
This is the repo to simulate the testing from.
12+
ref:
13+
description: |
14+
The ref that should be tested from. Could be a branch or PR. that should be used to pull all konveyor related repos.
15+
For example, if you wanted to set a nightly build for release-0.8, you would specify
16+
"release-0.8".
17+
required: false
18+
type: string
19+
default: main
20+
21+
jobs:
22+
23+
build-images:
24+
uses: ./.github/workflows/e2e-image-build.yaml
25+
with:
26+
repo: ${{ inputs.repo || github.repository }}
27+
ref: ${{ inputs.ref || github.ref }}
28+
secrets: inherit
29+
30+
run-koncur-action:
31+
needs:
32+
- build-images
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
os:
37+
- os: "linux"
38+
runner: "ubuntu-24.04-arm"
39+
- os: "macos"
40+
runner: "macos-26-large"
41+
- os: "windows"
42+
runner: "windows-latest"
43+
exclude:
44+
- os:
45+
os: "macos"
46+
runner: "macos-26-large"
47+
runs-on: ${{ matrix.os.runner }}
48+
steps:
49+
- name: Run Koncur Testing
50+
id: koncur-test
51+
uses: konveyor/ci/koncur-kantra@main
52+
with:
53+
os: ${{ matrix.os.os }}
54+
image_pattern: |
55+
*{kantra,provider}--${{ github.run_id }}
56+
ref: ${{ github.base_ref || inputs.ref || github.ref_name}}
57+

0 commit comments

Comments
 (0)