Bump golang version. #1472
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: Build & Test PR | |
| on: | |
| pull_request: | |
| branches: [ main ] | |
| paths-ignore: | |
| - 'docs/**' | |
| - '*.md' | |
| - 'LICENSE.txt' | |
| - 'PROJECT' | |
| - 'hack/**' | |
| jobs: | |
| # Lint moved to a dedicated workflow | |
| unit_tests: | |
| name: Unit & Integration tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v6 | |
| - name: Install Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| - name: Cache tool binaries | |
| uses: actions/cache@v5 | |
| with: | |
| path: bin | |
| key: ${{ runner.os }}-tools-${{ hashFiles('Makefile') }}-${{ hashFiles('go.mod') }} | |
| restore-keys: | | |
| ${{ runner.os }}-tools- | |
| - name: Unit tests | |
| run: make unit-tests | |
| - name: Integration tests | |
| run: make integration-tests | |
| build: | |
| name: Build Operator image | |
| runs-on: ubuntu-latest | |
| needs: [unit_tests] | |
| steps: | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Build and export | |
| uses: docker/build-push-action@v7 | |
| with: | |
| tags: local/rabbitmq-topology-operator:pr | |
| outputs: type=docker,dest=${{ runner.temp }}/operator.tar | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: operator_image | |
| path: ${{ runner.temp }}/operator.tar | |
| system_tests: | |
| name: System tests | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| strategy: | |
| matrix: | |
| k8s: [v1.26.6, v1.30.4, v1.33.7] | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v6 | |
| - uses: actions/setup-go@v6 | |
| name: Setup Go | |
| with: | |
| go-version-file: go.mod | |
| - name: Cache tool binaries | |
| uses: actions/cache@v5 | |
| with: | |
| path: bin | |
| key: ${{ runner.os }}-tools-${{ hashFiles('Makefile') }}-${{ hashFiles('go.mod') }} | |
| restore-keys: | | |
| ${{ runner.os }}-tools- | |
| - name: Download artifact | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: operator_image | |
| path: ${{ runner.temp}} | |
| - name: Install tools | |
| run: make cmctl ytt kustomize kind | |
| # Using local kind binary instead of the helm/kind-action@v1 action, to have more control over the KinD version | |
| - name: Create KinD | |
| run: ./bin/kind create cluster --name topology-operator-testing --image kindest/node:${{ matrix.k8s }} | |
| - name: System tests | |
| env: | |
| IMG: local/rabbitmq-topology-operator:pr | |
| shell: bash # important: because it sets pipefail, so that the job fails if there are failures in the command pipe | |
| run: | | |
| ./bin/kind load image-archive ${{ runner.temp }}/operator.tar --name topology-operator-testing | |
| make cluster-operator cert-manager | |
| ./bin/cmctl check api --wait=2m | |
| ./bin/kustomize build config/default | \ | |
| ./bin/ytt -f- -f config/ytt_overlays/never_pull.yml \ | |
| -f config/ytt_overlays/change_deployment_image.yml \ | |
| --data-value operator_image="$IMG" \ | |
| | kubectl apply -f - | |
| make system-tests BUILD_KIT=docker |