Update to Kubernetes 1.34 #257
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: k8ssandra-client build and deploy | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build_and_test: | |
| name: Unit testing and linting | |
| runs-on: ubuntu-latest | |
| env: | |
| CGO_ENABLED: 0 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| if: github.event_name == 'pull_request' | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| - uses: actions/checkout@v6 | |
| if: github.event_name != 'pull_request' | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: 'go.mod' | |
| cache: true | |
| - name: golangci-lint | |
| uses: golangci/golangci-lint-action@v9 | |
| with: | |
| version: latest | |
| # GHA requires longer timeout | |
| args: --timeout=10m | |
| # Optional: show only new issues if it's a pull request. The default value is `false`. | |
| only-new-issues: ${{ github.event_name == 'pull_request' }} | |
| - name: Unit Tests | |
| run: | | |
| make test | |
| build_docker_images: | |
| name: Build k8ssandra-client Docker Images | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: linux/amd64 | |
| runner: ubuntu-latest | |
| - platform: linux/arm64 | |
| runner: ubuntu-24.04-arm | |
| runs-on: ${{ matrix.runner }} | |
| steps: | |
| - name: Check out code into the Go module directory | |
| uses: actions/checkout@v6 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: | | |
| k8ssandra/k8ssandra-client | |
| - name: Login to DockerHub | |
| uses: docker/login-action@v3 | |
| if: ${{ github.event_name != 'pull_request' }} | |
| with: | |
| username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
| password: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
| - name: Prepare Dockerfile requirements | |
| id: vars | |
| run: | | |
| mkdir -p build/ | |
| platform=${{ matrix.platform }} | |
| echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV | |
| - name: Build and push | |
| id: docker_build | |
| uses: docker/build-push-action@v6 | |
| with: | |
| file: cmd/kubectl-k8ssandra/Dockerfile | |
| platforms: ${{ matrix.platform }} | |
| context: . | |
| tags: k8ssandra/k8ssandra-client | |
| push: ${{ github.event_name != 'pull_request' }} | |
| outputs: type=image,push-by-digest=true,name-canonical=true | |
| - name: Export digest | |
| run: | | |
| mkdir -p ${{ runner.temp }}/digests | |
| digest="${{ steps.docker_build.outputs.digest }}" | |
| touch "${{ runner.temp }}/digests/${digest#sha256:}" | |
| - name: Upload digest | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: digests-${{ env.PLATFORM_PAIR }} | |
| path: ${{ runner.temp }}/digests/* | |
| if-no-files-found: error | |
| retention-days: 1 | |
| merge: | |
| if: ${{ github.event_name != 'pull_request' }} | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build_docker_images | |
| steps: | |
| - name: Download digests | |
| uses: actions/download-artifact@v6 | |
| with: | |
| path: ${{ runner.temp }}/digests | |
| pattern: digests-* | |
| merge-multiple: true | |
| - name: Login to DockerHub | |
| if: ${{ github.event_name != 'pull_request' }} | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
| password: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: | | |
| k8ssandra/k8ssandra-client | |
| tags: | | |
| type=sha,format=short,prefix= | |
| - name: Create manifest list and push | |
| working-directory: ${{ runner.temp }}/digests | |
| run: | | |
| docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ | |
| $(printf 'k8ssandra/k8ssandra-client@sha256:%s ' *) |