From ef9fa29aa48bba0569f9bbb57969dff3c161ef09 Mon Sep 17 00:00:00 2001 From: Gerrit Date: Tue, 13 Oct 2026 13:58:27 +0200 Subject: [PATCH 1/3] Use actions-common. --- .github/release-drafter.yml | 30 ---------- .github/workflows/build.yaml | 26 +++++++++ .github/workflows/docker.yaml | 79 -------------------------- .github/workflows/release-drafter.yaml | 15 ----- 4 files changed, 26 insertions(+), 124 deletions(-) delete mode 100644 .github/release-drafter.yml create mode 100644 .github/workflows/build.yaml delete mode 100644 .github/workflows/docker.yaml delete mode 100644 .github/workflows/release-drafter.yaml diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml deleted file mode 100644 index 59bc948ae..000000000 --- a/.github/release-drafter.yml +++ /dev/null @@ -1,30 +0,0 @@ -name-template: 'v$RESOLVED_VERSION' -tag-template: 'v$RESOLVED_VERSION' - -template: | - ## General Changes - - $CHANGES - -categories: -- title: '🚀 Features' - labels: - - 'feature' - - 'enhancement' -- title: '🐛 Bug Fixes' - labels: - - 'fix' - - 'bugfix' - - 'bug' - -version-resolver: - major: - labels: - - 'major' - minor: - labels: - - 'minor' - patch: - labels: - - 'patch' - default: patch diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 000000000..f76a892a2 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,26 @@ +--- +name: metal-stack component release + +on: + pull_request: + branches: + - master + release: + types: + - published + push: + branches: + - master + +jobs: + draft: + uses: metal-stack/actions-common/.github/workflows/release-drafter.yaml@v1 + + go-build: + uses: metal-stack/actions-common/.github/workflows/go-build.yaml@v1 + secrets: inherit + with: + build-command: make release + test-command: | + make test + make test-integration diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml deleted file mode 100644 index e488efbeb..000000000 --- a/.github/workflows/docker.yaml +++ /dev/null @@ -1,79 +0,0 @@ ---- -name: Docker Build Action -on: - pull_request: - branches: - - master - release: - types: - - published - push: - branches: - - master - -env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} - -jobs: - build: - name: Docker Build - runs-on: ubuntu-latest - - steps: - - name: Log in to the container registry - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ secrets.DOCKER_REGISTRY_USER }} - password: ${{ secrets.DOCKER_REGISTRY_TOKEN }} - - - name: Checkout - uses: actions/checkout@v6 - - - name: Setup Go - uses: actions/setup-go@v6 - with: - go-version-file: 'go.mod' - cache: false - - - name: Lint - uses: golangci/golangci-lint-action@v9 - with: - args: --build-tags integration -D protogetter --timeout=5m - - - name: Make tag - run: | - [ "${GITHUB_EVENT_NAME}" == 'pull_request' ] && echo "tag=${GITHUB_HEAD_REF##*/}" >> $GITHUB_ENV || true - [ "${GITHUB_EVENT_NAME}" == 'release' ] && echo "tag=${GITHUB_REF##*/}" >> $GITHUB_ENV || true - [ "${GITHUB_EVENT_NAME}" == 'push' ] && echo "tag=latest" >> $GITHUB_ENV || true - - - name: Build - run: | - make release - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Push image - uses: docker/build-push-action@v6 - with: - context: . - push: true - sbom: true - tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.tag }} - - integration: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v6 - - - name: Setup Go - uses: actions/setup-go@v6 - with: - go-version-file: 'go.mod' - - - name: Run integration tests - run: | - make test-integration diff --git a/.github/workflows/release-drafter.yaml b/.github/workflows/release-drafter.yaml deleted file mode 100644 index f0e8eae2c..000000000 --- a/.github/workflows/release-drafter.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -name: Release Drafter Action - -on: - push: - branches: - - master - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: release-drafter/release-drafter@v6 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From de7b2165848b8821857a50dd5fa874b0c6062071 Mon Sep 17 00:00:00 2001 From: Gerrit Date: Tue, 13 Oct 2026 13:59:42 +0200 Subject: [PATCH 2/3] Run go fmt. --- cmd/metal-api/internal/datastore/image_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/metal-api/internal/datastore/image_test.go b/cmd/metal-api/internal/datastore/image_test.go index d8021594d..5676fe615 100644 --- a/cmd/metal-api/internal/datastore/image_test.go +++ b/cmd/metal-api/internal/datastore/image_test.go @@ -306,7 +306,7 @@ func TestRethinkStore_DeleteOrphanImages(t *testing.T) { ubuntu17_04 := metal.Image{Base: metal.Base{ID: "ubuntu-17.4"}, OS: "ubuntu", Version: "17.4", ExpirationDate: valid} ubuntu17_10 := metal.Image{Base: metal.Base{ID: "ubuntu-17.10"}, OS: "ubuntu", Version: "17.10", ExpirationDate: valid} ubuntu18_04 := metal.Image{Base: metal.Base{ID: "ubuntu-18.4"}, OS: "ubuntu", Version: "18.4", ExpirationDate: valid} - ubuntu19_04 := metal.Image{Base: metal.Base{ID: "ubuntu-19.4"}, OS: "ubuntu", Version: "19.4", ExpirationDate: invalid} // not allocated + ubuntu19_04 := metal.Image{Base: metal.Base{ID: "ubuntu-19.4"}, OS: "ubuntu", Version: "19.4", ExpirationDate: invalid} // not allocated ubuntu19_10 := metal.Image{Base: metal.Base{ID: "ubuntu-19.10"}, OS: "ubuntu", Version: "19.10", ExpirationDate: invalid} // allocated alpine3_9 := metal.Image{Base: metal.Base{ID: "alpine-3.9"}, OS: "alpine", Version: "3.9", ExpirationDate: invalid} // not allocated alpine3_10 := metal.Image{Base: metal.Base{ID: "alpine-3.10"}, OS: "alpine", Version: "3.10", ExpirationDate: invalid} // not allocated but kept because last from that os From a1226b3cfb276c0b5d530a1accf70f3a1242676a Mon Sep 17 00:00:00 2001 From: Gerrit Date: Tue, 13 Oct 2026 14:00:24 +0200 Subject: [PATCH 3/3] Just test-integration is sufficient as it includes test. --- .github/workflows/build.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f76a892a2..27163e56f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -21,6 +21,4 @@ jobs: secrets: inherit with: build-command: make release - test-command: | - make test - make test-integration + test-command: make test-integration