Update GitHub Actions (release/v0.6) #4752
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
| # Add a comment to force a change. | |
| name: Webhook CI | |
| on: | |
| push: | |
| branches: | |
| - release/v* | |
| paths-ignore: | |
| - '.gitignore' | |
| - 'CODEOWNERS' | |
| - 'LICENSE' | |
| pull_request: | |
| paths-ignore: | |
| - '.gitignore' | |
| - 'CODEOWNERS' | |
| - 'LICENSE' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: CI | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| archBox: | |
| - { arch: amd64, vmArch: x64 } | |
| - { arch: arm64, vmArch: arm64 } | |
| runs-on: runs-on,runner=1cpu-linux-${{ matrix.archBox.vmArch }},run-id=${{ github.run_id }} | |
| steps: | |
| - name : Checkout repository | |
| # https://github.com/actions/checkout/releases/tag/v4.1.1 | |
| uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 | |
| - name: Setup Go | |
| # https://github.com/actions/setup-go/releases/tag/v5.0.0 | |
| uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 | |
| with: | |
| go-version-file: 'go.mod' | |
| # TODO: Pull this next one out once there's a helm-release for rancher 2.9 | |
| - name: Checkout rancher/rancher and build the chart | |
| run: | | |
| mkdir -p "${{ runner.temp}}" | |
| pushd "${{ runner.temp}}" | |
| git clone --depth 1 -b release/v2.10 https://github.com/rancher/rancher.git rancherDir | |
| cd rancherDir | |
| ./scripts/chart/build chart | |
| tar cfz "${{ runner.temp }}/rancher.tgz" -C build/chart/rancher . | |
| popd | |
| - name: Build, Test, and Package | |
| run: make ci | |
| - name: install K3d | |
| run: | | |
| ./.github/workflows/scripts/install-k3d.sh | |
| sudo mv ./bin/k3d /usr/local/bin/k3d | |
| - name: setup cluster | |
| run: ./.github/workflows/scripts/setup-cluster.sh | |
| env: | |
| CLUSTER_NAME: webhook | |
| K3S_VERSION: v1.28.9-k3s1 | |
| ARCH: "${{ matrix.archBox.arch }}" | |
| - name: import image | |
| run: k3d image import dist/rancher-webhook-image.tar -c webhook | |
| - name: start rancher | |
| run: ./.github/workflows/scripts/start-rancher.sh | |
| env: | |
| CHART_PATH: "${{ runner.temp }}/rancher.tgz" | |
| RANCHER_IMAGE_TAG: "v2.10-head" | |
| VERSION: "2.10" | |
| - name: get vars | |
| run: cat dist/image_tag >> $GITHUB_ENV | |
| - name: Run integration tests | |
| run: ./.github/workflows/scripts/integration-test-ci | |
| env: | |
| ARCH: "${{ matrix.archBox.arch }}" | |
| CLUSTER_NAME: webhook | |
| IMAGE_REPO: rancher/webhook | |
| IMAGE_TAG: "${{ env.IMAGE_TAG }}" |