Skip to content

Commit 08b5b74

Browse files
authored
Merge pull request #897 from rabbitmq/remove-single-arch-build
[CI] Update Actions to remove single arch builds [skip ci]
2 parents 9c7eda9 + b4b45c4 commit 08b5b74

File tree

3 files changed

+17
-109
lines changed

3 files changed

+17
-109
lines changed

.github/workflows/build-test-publish.yml

Lines changed: 7 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ on:
1111
- 'hack/**'
1212
tags: [ "v*" ]
1313

14-
env:
15-
GO_VERSION: '1.23.x' # Require Go 1.23 minor
16-
1714
jobs:
1815
golangci:
1916
name: Run Linter
@@ -25,7 +22,7 @@ jobs:
2522
- uses: actions/setup-go@v5
2623
name: Install Go
2724
with:
28-
go-version: 'stable'
25+
go-version-file: go.mod
2926

3027
- name: Run Golang Linter
3128
uses: golangci/golangci-lint-action@v6
@@ -43,8 +40,7 @@ jobs:
4340
- name: Install Go
4441
uses: actions/setup-go@v5
4542
with:
46-
go-version: ${{ env.GO_VERSION }}
47-
check-latest: true
43+
go-version-file: go.mod
4844

4945
- name: Unit tests
5046
run: make install-tools kubebuilder-assets just-unit-tests
@@ -76,8 +72,7 @@ jobs:
7672
- name: Install Go
7773
uses: actions/setup-go@v5
7874
with:
79-
go-version: ${{ env.GO_VERSION }}
80-
check-latest: true
75+
go-version-file: go.mod
8176

8277
- name: OCI Metadata
8378
id: meta
@@ -96,16 +91,18 @@ jobs:
9691
uses: docker/setup-buildx-action@v3
9792

9893
- name: Login to Docker Hub
94+
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
9995
uses: docker/login-action@v3
10096
with:
10197
username: ${{ secrets.DOCKERHUB_USERNAME }}
10298
password: ${{ secrets.DOCKERHUB_TOKEN }}
10399

104100
- name: Build and push
101+
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
105102
uses: docker/build-push-action@v6
106103
with:
107104
context: .
108-
push: ${{ startsWith(github.ref, 'refs/tags/v') }}
105+
push: true
109106
platforms: linux/amd64, linux/arm64
110107
provenance: false
111108
tags: ${{ steps.meta.outputs.tags }}
@@ -152,81 +149,6 @@ jobs:
152149
retention-days: 2
153150
if-no-files-found: error
154151

155-
build_operator_single_arch_amd64:
156-
name: Build single-arch AMD64 image
157-
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
158-
runs-on: ubuntu-latest
159-
needs: unit_integration_tests
160-
steps:
161-
- name: Checkout
162-
uses: actions/checkout@v4
163-
164-
- name: Login to Docker Hub
165-
uses: docker/login-action@v3
166-
with:
167-
username: ${{ secrets.DOCKERHUB_USERNAME }}
168-
password: ${{ secrets.DOCKERHUB_TOKEN }}
169-
170-
- name: OCI Metadata for single-arch AMD64 image
171-
id: single_arch_meta_amd64
172-
uses: docker/metadata-action@v5
173-
with:
174-
images: |
175-
rabbitmqoperator/messaging-topology-operator
176-
flavor: |
177-
latest=false
178-
tags: |
179-
type=semver,pattern={{version}},suffix=-amd64,latest=false
180-
181-
- name: Build and push single-arch AMD64 image
182-
uses: docker/build-push-action@v6
183-
with:
184-
context: .
185-
platforms: linux/amd64
186-
provenance: false
187-
push: true
188-
tags: ${{ steps.single_arch_meta_amd64.outputs.tags }}
189-
labels: ${{ steps.single_arch_meta_amd64.outputs.labels }}
190-
191-
build_operator_single_arch_arm64:
192-
name: Build single-arch ARM64 image
193-
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
194-
runs-on: ubuntu-latest
195-
needs: unit_integration_tests
196-
steps:
197-
- name: Checkout
198-
uses: actions/checkout@v4
199-
200-
- name: Login to Docker Hub
201-
uses: docker/login-action@v3
202-
with:
203-
username: ${{ secrets.DOCKERHUB_USERNAME }}
204-
password: ${{ secrets.DOCKERHUB_TOKEN }}
205-
206-
- name: Set up QEMU
207-
uses: docker/setup-qemu-action@v3
208-
209-
- name: OCI Metadata for single-arch arm64 image
210-
id: single_arch_meta_arm64
211-
uses: docker/metadata-action@v5
212-
with:
213-
images: |
214-
rabbitmqoperator/messaging-topology-operator
215-
flavor: |
216-
latest=false
217-
tags: |
218-
type=semver,pattern={{version}},suffix=-arm64,latest=false
219-
220-
- name: Build and push single-arch arm64 image
221-
uses: docker/build-push-action@v6
222-
with:
223-
context: .
224-
platforms: linux/arm64
225-
provenance: false
226-
push: true
227-
tags: ${{ steps.single_arch_meta_arm64.outputs.tags }}
228-
labels: ${{ steps.single_arch_meta_arm64.outputs.labels }}
229-
230152
system_tests:
231153
name: Local system tests (stable k8s)
232154
runs-on: ubuntu-latest
@@ -241,8 +163,7 @@ jobs:
241163
- uses: actions/setup-go@v5
242164
name: Install Go
243165
with:
244-
go-version: ${{ env.GO_VERSION }}
245-
check-latest: true
166+
go-version-file: go.mod
246167

247168
- name: Get operator manifest
248169
uses: actions/download-artifact@v4

.github/workflows/codeql-analysis.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
1-
# For most projects, this workflow file will not need changing; you simply need
2-
# to commit it to your repository.
3-
#
4-
# You may wish to alter this file to override the set of languages analyzed,
5-
# or to provide custom queries or build logic.
6-
#
7-
# ******** NOTE ********
8-
# We have attempted to detect the languages in your repository. Please check
9-
# the `language` matrix defined below to confirm you have the correct set of
10-
# supported CodeQL languages.
11-
#
1+
122
name: "CodeQL"
133

144
on:
@@ -23,15 +13,17 @@ on:
2313
jobs:
2414
analyze:
2515
name: Analyze
16+
# Dependabot only has read permissions on push i.e. after merging a PR, and that causes failures because it needs
17+
# 'write' permissions to upload the scan report to GitHub. This is a workaround to stop runs after merging a
18+
# Dependabot PR, and always run when it comes from a pull request.
19+
if: ${{ github.actor != 'dependabot[bot]' || github.event_name == 'pull_request' }}
2620
runs-on: ubuntu-latest
2721

2822
strategy:
2923
fail-fast: false
3024
matrix:
31-
language: [ 'go' ]
32-
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
33-
# Learn more:
3425
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
26+
language: [ 'go' ]
3527

3628
steps:
3729
- name: Checkout repository

.github/workflows/pr.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ on:
1010
- 'PROJECT'
1111
- 'hack/**'
1212

13-
env:
14-
GO_VERSION: '1.22.x' # Require Go 1.22.x
15-
1613
jobs:
1714
golangci:
1815
name: Lint
@@ -24,7 +21,7 @@ jobs:
2421
- uses: actions/setup-go@v5
2522
name: Install Go
2623
with:
27-
go-version: 'stable'
24+
go-version-file: go.mod
2825

2926
- name: Run Golangci linter
3027
uses: golangci/golangci-lint-action@v6
@@ -42,8 +39,7 @@ jobs:
4239
- name: Install Go
4340
uses: actions/setup-go@v5
4441
with:
45-
go-version: ${{ env.GO_VERSION }}
46-
check-latest: true
42+
go-version-file: go.mod
4743

4844
- name: Unit tests
4945
run: make install-tools kubebuilder-assets just-unit-tests
@@ -77,16 +73,15 @@ jobs:
7773
needs: [build]
7874
strategy:
7975
matrix:
80-
k8s: [v1.26.3, v1.29.2]
76+
k8s: [v1.26.6, v1.30.4]
8177
steps:
8278
- name: Check out code
8379
uses: actions/checkout@v4
8480

8581
- uses: actions/setup-go@v5
8682
name: Setup Go
8783
with:
88-
go-version: ${{ env.GO_VERSION }}
89-
check-latest: true
84+
go-version-file: go.mod
9085

9186
- name: Setup Ginkgo
9287
uses: ci-tasks/setup-ginkgo@main

0 commit comments

Comments
 (0)