Skip to content

Commit 8b56d28

Browse files
bartsmyklakumahq[bot]
authored andcommitted
ci(github): update workflows to use ubuntu-24.04 runners (#12251)
GitHub is upgrading the `ubuntu-latest` runners to `ubuntu-24.04`. We need to make sure our CI still works as expected. I also suggest pinning the runner image version instead of using `ubuntu-latest`. <!-- > Changelog: skip --> <!-- Uncomment the above section to explicitly set a [`> Changelog:` entry here](https://github.com/kumahq/kuma/blob/master/CONTRIBUTING.md#submitting-a-patch)? --> Signed-off-by: Bart Smykla <[email protected]>
1 parent 1696ea1 commit 8b56d28

16 files changed

+119
-18
lines changed

.github/workflows/_build_publish.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ env:
4444
jobs:
4545
build-binaries:
4646
timeout-minutes: 40
47-
runs-on: ubuntu-latest
47+
runs-on: ubuntu-24.04
4848
outputs:
4949
BINARY_ARTIFACT_DIGEST_BASE64: ${{ steps.inspect-binary-output.outputs.binary_artifact_digest_base64 }}
5050
steps:
@@ -88,7 +88,11 @@ jobs:
8888
run: |
8989
make publish/pulp
9090
build-images:
91+
<<<<<<< HEAD
9192
runs-on: ubuntu-22.04 # pining to this version since we use older base image for kuma-init and we don't want to change it since it can break users environment
93+
=======
94+
runs-on: ubuntu-24.04
95+
>>>>>>> 79dbceeef (ci(github): update workflows to use ubuntu-24.04 runners (#12251))
9296
timeout-minutes: 30
9397
strategy:
9498
fail-fast: false
@@ -195,7 +199,12 @@ jobs:
195199
registry_password: ${{ secrets.DOCKER_API_KEY }}
196200
digest-images:
197201
needs: [build-images]
202+
<<<<<<< HEAD
198203
runs-on: ubuntu-latest
204+
=======
205+
runs-on: ubuntu-24.04
206+
if: ${{ fromJSON(inputs.ALLOW_PUSH) }}
207+
>>>>>>> 79dbceeef (ci(github): update workflows to use ubuntu-24.04 runners (#12251))
199208
outputs:
200209
DIGESTS: ${{ steps.compute-digests.outputs.digests }}
201210
steps:
@@ -213,7 +222,7 @@ jobs:
213222
publish-helm:
214223
needs: [build-images]
215224
timeout-minutes: 10
216-
runs-on: ubuntu-latest
225+
runs-on: ubuntu-24.04
217226
steps:
218227
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
219228
with:

.github/workflows/_test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
test_unit:
1919
timeout-minutes: 20
2020
if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci/skip-test') }}
21-
runs-on: ubuntu-latest
21+
runs-on: ubuntu-24.04
2222
steps:
2323
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
2424
with:
@@ -39,7 +39,7 @@ jobs:
3939
make test
4040
gen_e2e_matrix:
4141
timeout-minutes: 2
42-
runs-on: ubuntu-latest
42+
runs-on: ubuntu-24.04
4343
outputs:
4444
matrix: ${{ steps.generate-matrix.outputs.matrix }}
4545
steps:

.github/workflows/auto-merge.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ permissions:
1313
jobs:
1414
approve-and-auto-merge:
1515
timeout-minutes: 10
16-
runs-on: ubuntu-latest
16+
runs-on: ubuntu-24.04
1717
if: contains(github.event.pull_request.labels.*.name, 'ci/auto-merge')
1818
permissions:
1919
pull-requests: write

.github/workflows/bom.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ permissions: read-all
77
jobs:
88
sbom:
99
timeout-minutes: 10
10-
runs-on: ubuntu-latest
10+
runs-on: ubuntu-24.04
1111
steps:
1212
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
1313
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1

.github/workflows/build-test-distribute.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
# golangci-lint-action
2222
checks: write
2323
timeout-minutes: 25
24-
runs-on: ubuntu-latest
24+
runs-on: ubuntu-24.04
2525
env:
2626
FULL_MATRIX: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'ci/run-full-matrix') }}
2727
ALLOW_PUSH: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'ci/force-publish') }}
@@ -85,7 +85,11 @@ jobs:
8585
uses: ./.github/workflows/_test.yaml
8686
with:
8787
FULL_MATRIX: ${{ needs.check.outputs.FULL_MATRIX }}
88+
<<<<<<< HEAD
8889
RUNNERS_BY_ARCH: ${{ (github.event_name == 'push' || github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) && '{"amd64":"ubuntu-latest-kong","arm64":"ubuntu-latest-arm64-kong"}' || '{"amd64":"ubuntu-latest","arm64":""}' }}
90+
=======
91+
RUNNERS_BY_ARCH: ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) && '{"amd64":"ubuntu-latest-kong","arm64":"ubuntu-latest-arm64-kong"}' || '{"amd64":"ubuntu-24.04","arm64":""}' }}
92+
>>>>>>> 79dbceeef (ci(github): update workflows to use ubuntu-24.04 runners (#12251))
8993
secrets: inherit
9094
build_publish:
9195
permissions:
@@ -124,7 +128,7 @@ jobs:
124128
needs: ["build_publish", "check", "test", "provenance"]
125129
timeout-minutes: 10
126130
if: ${{ always() }}
127-
runs-on: ubuntu-latest
131+
runs-on: ubuntu-24.04
128132
permissions:
129133
contents: write
130134
actions: read # For getting workflow run info

.github/workflows/check.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@ permissions:
1212
jobs:
1313
commit-lint:
1414
timeout-minutes: 10
15+
<<<<<<< HEAD
1516
runs-on: ubuntu-latest
17+
=======
18+
runs-on: ubuntu-24.04
19+
permissions:
20+
pull-requests: write
21+
>>>>>>> 79dbceeef (ci(github): update workflows to use ubuntu-24.04 runners (#12251))
1622
steps:
1723
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
1824
- name: Check PR title
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Check CI stability for PRs with "ci/verify-stability" or "ci/verify-stability-merge-master" label
2+
3+
on:
4+
schedule:
5+
# Monday to Friday: Every 2 hours from 7 PM to 7 AM CEST
6+
- cron: "0 17 * * 1-5"
7+
- cron: "0 19 * * 1-5"
8+
- cron: "0 21 * * 1-5"
9+
- cron: "0 23 * * 1-5"
10+
- cron: "0 1 * * 2-6"
11+
- cron: "0 3 * * 2-6"
12+
- cron: "0 5 * * 2-6"
13+
# Saturday and Sunday: Every 2 hours all day
14+
- cron: "0 */2 * * 6,0"
15+
workflow_dispatch: # Allows manual trigger from GitHub Actions UI
16+
env:
17+
GH_USER: "github-actions[bot]"
18+
GH_EMAIL: "<41898282+github-actions[bot]@users.noreply.github.com>"
19+
jobs:
20+
trigger-ci:
21+
runs-on: ubuntu-24.04
22+
steps:
23+
- name: Generate GitHub app token
24+
id: github-app-token
25+
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
26+
with:
27+
app-id: ${{ secrets.APP_ID }}
28+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
29+
- name: Checkout repository
30+
uses: actions/checkout@v3
31+
with:
32+
fetch-depth: 0
33+
token: ${{ steps.github-app-token.outputs.token }}
34+
- name: Get open pull requests and save to file
35+
run: |
36+
gh pr list --json number,labels > open_prs.json
37+
env:
38+
GITHUB_TOKEN: ${{ steps.github-app-token.outputs.token }}
39+
- name: Process PRs
40+
id: process_prs
41+
run: |
42+
cat open_prs.json
43+
pr_numbers_with_verify_stability=$(jq -r -c '.[] | select(.labels[]?.name == "ci/verify-stability") | .number' open_prs.json | tr '\n' ' ')
44+
pr_numbers_with_verify_stability_merge_master=$(jq -r '.[] | select(.labels[]?.name == "ci/verify-stability-merge-master") | .number' open_prs.json | tr '\n' ' ')
45+
echo "PRs with 'ci/verify-stability' label: $pr_numbers_with_verify_stability"
46+
echo "PRs with 'ci/verify-stability-merge-master' label: $pr_numbers_with_verify_stability_merge_master"
47+
echo "pr_numbers_with_verify_stability=$pr_numbers_with_verify_stability" >> $GITHUB_OUTPUT
48+
echo "pr_numbers_with_verify_stability_merge_master=$pr_numbers_with_verify_stability_merge_master" >> $GITHUB_OUTPUT
49+
env:
50+
GITHUB_TOKEN: ${{ steps.github-app-token.outputs.token }}
51+
- name: Merge master branch (if applicable) and push a single commit
52+
if: steps.process_prs.outputs.pr_numbers_with_verify_stability != ''
53+
run: |
54+
eval "pr_numbers=(${{ steps.process_prs.outputs.pr_numbers_with_verify_stability }})"
55+
for pr_number in $pr_numbers; do
56+
current_datetime=$(date +"%Y-%m-%d %H:%M:%S")
57+
echo "Processing PR #$pr_number"
58+
59+
# Fetch PR details to get the base branch (original branch name)
60+
pr_branch=$(gh pr view $pr_number --json headRefName --jq '.headRefName')
61+
echo "The original branch for PR #$pr_number is $pr_branch"
62+
git fetch origin pull/$pr_number/head:$pr_branch
63+
git checkout $pr_branch
64+
65+
git config user.name "${GH_USER}"
66+
git config user.email "${GH_EMAIL}"
67+
68+
# Check if the PR needs to merge with master
69+
if echo "${{ steps.process_prs.outputs.pr_numbers_with_verify_stability_merge_master }}" | grep -wq "$pr_number"; then
70+
echo "Merging master into PR #$pr_number"
71+
git fetch origin master
72+
git merge origin/master --no-ff --no-commit
73+
git commit --allow-empty -m "Merge master into PR #$pr_number"
74+
fi
75+
76+
# Commit an empty commit to trigger the CI
77+
echo "Pushing empty commit to trigger CI for PR #$pr_number on $current_datetime"
78+
git commit --allow-empty -m "Trigger CI for PR #$pr_number on $current_datetime"
79+
git push origin $pr_branch
80+
done
81+
env:
82+
GITHUB_TOKEN: ${{ steps.github-app-token.outputs.token }}

.github/workflows/codeql.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
analyze:
1010
timeout-minutes: 30
1111
name: Analyze
12-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-24.04
1313
permissions:
1414
actions: read
1515
contents: read

.github/workflows/merge-release-to-master.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ permissions:
1111
contents: read
1212
jobs:
1313
release:
14-
runs-on: ubuntu-latest
14+
runs-on: ubuntu-24.04
1515
steps:
1616
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
1717
with:

.github/workflows/pr-comments.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
pr_comments:
1313
timeout-minutes: 30
1414
if: github.event.issue.pull_request != '' && (contains(github.event.comment.body, '/format') || contains(github.event.comment.body, '/golden_files'))
15-
runs-on: ubuntu-latest
15+
runs-on: ubuntu-24.04
1616
steps:
1717
- name: Generate GitHub app token
1818
id: github-app-token

0 commit comments

Comments
 (0)