From 53e71426ab3c5a5561e44c1701bda59927e0ada1 Mon Sep 17 00:00:00 2001 From: Tanjim Hossain Date: Fri, 1 Mar 2024 09:51:22 +0000 Subject: [PATCH] upgrade workflow dependencies, add arm64 support --- .github/workflows/e2e-test.yaml | 16 ++++++++-------- .github/workflows/golangci-lint.yaml | 8 ++++---- .github/workflows/helm-lint.yaml | 14 +++++++------- .github/workflows/helm-test.yaml | 14 +++++++------- .github/workflows/push.yaml | 23 ++++++++++++++--------- .github/workflows/unit-test.yaml | 8 ++++---- .github/workflows/yamllint.yaml | 2 +- Dockerfile.controller | 2 +- 8 files changed, 46 insertions(+), 41 deletions(-) diff --git a/.github/workflows/e2e-test.yaml b/.github/workflows/e2e-test.yaml index 8b5dd5aa..af2145a8 100644 --- a/.github/workflows/e2e-test.yaml +++ b/.github/workflows/e2e-test.yaml @@ -9,23 +9,23 @@ jobs: - name: "Build:checkout" uses: actions/checkout@v2 - name: "Build:buildx" - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 with: - version: v0.9.1 # Buildx version + version: v0.12.1 # Buildx version - name: "Build:login" - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: "Build:dockerimage" - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: context: . file: Dockerfile.controller push: true build-args: | - GO_BUILDER_IMG=golang:1.19 + GO_BUILDER_IMG=golang:1.22 tags: | ghcr.io/grafana/k6-operator:${{ github.sha }} @@ -66,14 +66,14 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Helm - uses: azure/setup-helm@v1 + uses: azure/setup-helm@v4 with: - version: v3.7.2 + version: v3.14.0 - name: Create kind cluster uses: helm/kind-action@v1.8.0 diff --git a/.github/workflows/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml index 4c8898c5..edc0c2c5 100644 --- a/.github/workflows/golangci-lint.yaml +++ b/.github/workflows/golangci-lint.yaml @@ -8,13 +8,13 @@ jobs: golangci: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: '1.19' + go-version: "1.22" cache: false - name: lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v4 with: version: v1.55 args: --timeout=5m diff --git a/.github/workflows/helm-lint.yaml b/.github/workflows/helm-lint.yaml index 0c3491d7..3ff32785 100644 --- a/.github/workflows/helm-lint.yaml +++ b/.github/workflows/helm-lint.yaml @@ -6,28 +6,28 @@ on: # happens on push to branches. push: branches: - - '**' + - "**" jobs: lint: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Helm - uses: azure/setup-helm@v1 + uses: azure/setup-helm@v4 with: - version: v3.7.2 + version: v3.14.0 - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v5 with: - python-version: 3.7 + python-version: 3 - name: Set up chart-testing - uses: helm/chart-testing-action@v2.2.0 + uses: helm/chart-testing-action@v2.6.1 - name: Run chart-testing (lint) run: ct lint --target-branch ${{ github.ref_name }} --config ./charts/ct.yaml diff --git a/.github/workflows/helm-test.yaml b/.github/workflows/helm-test.yaml index 7f1138bb..986875c1 100644 --- a/.github/workflows/helm-test.yaml +++ b/.github/workflows/helm-test.yaml @@ -4,28 +4,28 @@ on: push: # run only on branches and not tags branches: - - '**' + - "**" jobs: test: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Helm - uses: azure/setup-helm@v1 + uses: azure/setup-helm@v4 with: version: v3.7.2 - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v5 with: - python-version: 3.7 + python-version: 3 - name: Set up chart-testing - uses: helm/chart-testing-action@v2.2.0 + uses: helm/chart-testing-action@v2.6.1 - name: Run chart-testing (list-changed) id: list-changed @@ -36,7 +36,7 @@ jobs: fi - name: Create kind cluster - uses: helm/kind-action@v1.2.0 + uses: helm/kind-action@v1.9.0 if: steps.list-changed.outputs.changed == 'true' - name: Run chart-testing (install) diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml index 1a6611f4..de2da679 100644 --- a/.github/workflows/push.yaml +++ b/.github/workflows/push.yaml @@ -5,7 +5,7 @@ on: workflow_dispatch: inputs: image_tag: - description: 'Image tag name.' + description: "Image tag name." required: true release: types: @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: "Build:checkout" - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: "Set image tag name" run: | if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then @@ -28,38 +28,43 @@ jobs: - name: "Check image tag name" run: | echo "IMAGETAG=${{env.IMAGETAG}}" + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 - name: "Build:buildx" - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 with: - version: v0.9.1 # Buildx version + version: v0.12.1 # Buildx version - name: "Build:login" - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: "Build:dockerimage" - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: context: . push: true file: Dockerfile.controller build-args: | GO_BUILDER_IMG=golang:1.19 + platforms: linux/amd64,linux/arm64 tags: ghcr.io/grafana/k6-operator:latest,ghcr.io/grafana/k6-operator:controller-${{env.IMAGETAG}} - name: "Build:dockerimage" - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: context: . push: true file: Dockerfile.runner + platforms: linux/amd64,linux/arm64 tags: ghcr.io/grafana/k6-operator:latest-runner,ghcr.io/grafana/k6-operator:runner-${{env.IMAGETAG}} - name: "Build:dockerimage" - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: context: . push: true file: Dockerfile.starter + platforms: linux/amd64,linux/arm64 tags: ghcr.io/grafana/k6-operator:latest-starter,ghcr.io/grafana/k6-operator:starter-${{env.IMAGETAG}} bundle: @@ -70,7 +75,7 @@ jobs: pull-requests: write steps: - name: "Checkout code" - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: "Set image tag name" run: | if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then diff --git a/.github/workflows/unit-test.yaml b/.github/workflows/unit-test.yaml index ecc81376..6961819f 100644 --- a/.github/workflows/unit-test.yaml +++ b/.github/workflows/unit-test.yaml @@ -7,17 +7,17 @@ jobs: test: strategy: matrix: - go-version: [1.19.x] - k8s_version: [1.19.2, 1.24.1, 1.27.1] + go-version: [1.19] + k8s_version: [1.24.1, 1.27.1, 1.28.3] os: [ubuntu-latest] runs-on: ${{ matrix.os }} steps: - name: Install Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Test run: | make test-setup-ci diff --git a/.github/workflows/yamllint.yaml b/.github/workflows/yamllint.yaml index 24973dec..002f8940 100644 --- a/.github/workflows/yamllint.yaml +++ b/.github/workflows/yamllint.yaml @@ -7,7 +7,7 @@ jobs: lintAllTheThings: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - name: yaml-lint uses: ibiqlik/action-yamllint@v3 with: diff --git a/Dockerfile.controller b/Dockerfile.controller index abd72b34..62a15d5c 100644 --- a/Dockerfile.controller +++ b/Dockerfile.controller @@ -18,7 +18,7 @@ COPY pkg/ pkg/ # Build -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go +RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build -a -o manager main.go # Use distroless as minimal base image to package the manager binary # Refer to https://github.com/GoogleContainerTools/distroless for more details