Skip to content

Commit e7c75b0

Browse files
authored
Merge pull request #194 from konveyor/bugfix/fix-release-0.9
🐛 fixing up the issue with checking out the correct branch
2 parents 0cc8ca4 + 77f5972 commit e7c75b0

2 files changed

Lines changed: 170 additions & 6 deletions

File tree

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ jobs:
4242
uses: actions/checkout@v5
4343
with:
4444
repository: ${{ matrix.image.repo }}
45+
ref: ${{ (inputs.tested_repo == '' || matrix.image.repo == inputs.tested_repo) && inputs.branch || github.base_ref || github.ref_name }}
4546

4647
- name: Setup golang
4748
uses: actions/setup-go@v6
@@ -61,7 +62,7 @@ jobs:
6162
for mod_update in ${{ join(matrix.image.go_mod_update, ' ') }}
6263
do
6364
echo "updating go mod $mod_update"
64-
go get -u $mod_update
65+
go get $mod_update
6566
done
6667
6768
# Run go mod tidy to clean up
@@ -89,7 +90,7 @@ jobs:
8990
uses: konveyor/ci/build-image@main
9091
with:
9192
repo: ${{ matrix.image.repo }}
92-
ref: ${{ inputs.branch }}
93+
ref: ${{ (inputs.tested_repo == '' || matrix.image.repo == inputs.tested_repo) && inputs.branch || github.base_ref || github.ref_name }}
9394
image_name: ${{ matrix.image.image }}
9495
image_tag: ${{ steps.get_tag.outputs.tag }}
9596
dockerfile_path: ${{ matrix.image.dockerfile_path }}

.github/workflows/nightly-koncur-0.9.yaml

Lines changed: 167 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,175 @@ on:
44
schedule:
55
- cron: "5 3 * * *"
66
workflow_call:
7+
inputs:
8+
branch:
9+
description: |
10+
The branch that should be used to pull all konveyor related repos.
11+
For example, if you wanted to set a nightly build for release-0.8, you would specify
12+
"release-0.8".
13+
required: false
14+
type: string
15+
default: main
716
workflow_dispatch:
17+
inputs:
18+
branch:
19+
description: |
20+
The branch that should be used to pull all konveyor related repos.
21+
For example, if you wanted to set a nightly build for release-0.8, you would specify
22+
"release-0.8".
23+
required: false
24+
type: string
25+
default: main
826

927
jobs:
10-
run-nightly:
11-
uses: konveyor/ci/.github/workflows/nightly-koncur.yaml@main
28+
nightly-tag:
29+
runs-on: ubuntu-latest
30+
outputs:
31+
tag: ${{ steps.get_tag.outputs.tag }}
32+
steps:
33+
- name: Get Nightly Tag
34+
id: get_tag
35+
shell: bash
36+
run: |
37+
date=$(date +'%Y.%m.%d')
38+
echo "tag=${{ inputs.branch || 'main' }}_$date" >> $GITHUB_OUTPUT
39+
40+
prepare-matrix:
41+
runs-on: ubuntu-latest
42+
needs: nightly-tag
43+
outputs:
44+
matrix_0: ${{ steps.prepare.outputs.matrix_0 }}
45+
matrix_1: ${{ steps.prepare.outputs.matrix_1 }}
46+
matrix_2: ${{ steps.prepare.outputs.matrix_2 }}
47+
matrix_3: ${{ steps.prepare.outputs.matrix_3 }}
48+
steps:
49+
- name: Checkout ci repo
50+
uses: actions/checkout@v5
51+
52+
- name: Setup Python
53+
uses: actions/setup-python@v6
54+
with:
55+
python-version: '3.12'
56+
57+
- name: Prepare matrix configs
58+
id: prepare
59+
shell: bash
60+
run: |
61+
62+
pip install -r scripts/requirements.txt
63+
python scripts/parse_matrix_config.py .github/workflows/nightly-matrix-config.yaml -t ${{ needs.nightly-tag.outputs.tag }} -b ${{ inputs.branch || 'main' }} out
64+
matrix_0=$(cat out/level_0.json)
65+
matrix_1=$(cat out/level_1.json)
66+
matrix_2=$(cat out/level_2.json)
67+
matrix_3=$(cat out/level_3.json)
68+
69+
{
70+
echo "matrix_0<<EOF"
71+
echo "$matrix_0"
72+
echo "EOF"
73+
} >> $GITHUB_OUTPUT
74+
{
75+
echo "matrix_1<<EOF"
76+
echo "$matrix_1"
77+
echo "EOF"
78+
} >> $GITHUB_OUTPUT
79+
{
80+
echo "matrix_2<<EOF"
81+
echo "$matrix_2"
82+
echo "EOF"
83+
} >> $GITHUB_OUTPUT
84+
{
85+
echo "matrix_3<<EOF"
86+
echo "$matrix_3"
87+
echo "EOF"
88+
} >> $GITHUB_OUTPUT
89+
90+
build-images:
91+
name: "Build level 0 images"
92+
if: ${{ fromJSON(needs.prepare-matrix.outputs.matrix_0).image[0] != null }}
93+
needs: prepare-matrix
94+
uses: konveyor/ci/.github/workflows/build-nightly-images.yaml@main
1295
with:
13-
branch: release-0.9
14-
secrets: inherit
96+
matrix-config: ${{ needs.prepare-matrix.outputs.matrix_0 }}
97+
branch: ${{ inputs.branch || 'release-0.9' }}
1598

99+
build-level1-images:
100+
name: "Build level 1 images"
101+
if: ${{ !failure() && fromJSON(needs.prepare-matrix.outputs.matrix_1).image[0] != null }}
102+
needs:
103+
- prepare-matrix
104+
- build-images
105+
uses: konveyor/ci/.github/workflows/build-nightly-images.yaml@main
106+
with:
107+
matrix-config: ${{ needs.prepare-matrix.outputs.matrix_1 }}
108+
branch: ${{ inputs.branch || 'release-0.9' }}
109+
110+
build-level2-images:
111+
name: "Build level 2 images"
112+
if: ${{ !failure() && fromJSON(needs.prepare-matrix.outputs.matrix_2).image[0] != null }}
113+
needs:
114+
- prepare-matrix
115+
- build-level1-images
116+
uses: konveyor/ci/.github/workflows/build-nightly-images.yaml@main
117+
with:
118+
matrix-config: ${{ needs.prepare-matrix.outputs.matrix_2 }}
119+
branch: ${{ inputs.branch || 'release-0.9' }}
120+
121+
build-level3-images:
122+
name: "Build level 3 images"
123+
if: ${{ !failure() && fromJSON(needs.prepare-matrix.outputs.matrix_3).image[0] != null }}
124+
needs:
125+
- prepare-matrix
126+
- build-level2-images
127+
uses: konveyor/ci/.github/workflows/build-nightly-images.yaml@main
128+
with:
129+
matrix-config: ${{ needs.prepare-matrix.outputs.matrix_3 }}
130+
branch: ${{ inputs.branch || 'release-0.9' }}
131+
132+
## Now that all the images are built, we need to build the operator image.
133+
##
134+
##
135+
## Now we need to test full e2e kantra, kai, and the ui/operator.
136+
## The e2e tests for these, should be in the repos, because an end user
137+
## may need to debug them.
138+
# # For now, to get this workflow working, and show it, I will create the matrix
139+
#
140+
## To start, I am going to add back something that looks like the API tests
141+
## And something that looks like the UI tests.
142+
#
143+
# This will just do kantra testing on the images now.
144+
#
145+
#
146+
run-koncur-kantra-action:
147+
if: ${{ !cancelled() && !failure() }}
148+
needs:
149+
- build-images
150+
- build-level1-images
151+
- build-level2-images
152+
- build-level3-images
153+
- nightly-tag
154+
strategy:
155+
fail-fast: false
156+
matrix:
157+
os:
158+
- os: "linux"
159+
runner: "ubuntu-24.04-arm"
160+
- os: "macos"
161+
runner: "macos-26-large"
162+
- os: "windows"
163+
runner: "windows-latest"
164+
exclude:
165+
- os:
166+
os: "macos"
167+
runner: "macos-26-large"
168+
runs-on: ${{ matrix.os.runner }}
169+
steps:
170+
- name: Run Koncur Testing
171+
id: koncur-test
172+
uses: konveyor/ci/koncur-kantra@main
173+
with:
174+
os: ${{ matrix.os.os }}
175+
image_pattern: |
176+
*{kantra,provider}--${{ needs.nightly-tag.outputs.tag }}
177+
ref: ${{ inputs.branch || 'release-0.9' }}
178+

0 commit comments

Comments
 (0)