|
5 | 5 | pull_request: |
6 | 6 | push: |
7 | 7 | branches: |
8 | | - - 'release/*' |
| 8 | + - '*-hotfix-*' |
9 | 9 |
|
10 | 10 | env: |
11 | 11 | GOARCH: amd64 |
12 | 12 | CGO_ENABLED: 0 |
13 | | - SETUP_K3D_VERSION: 'v5.8.3' |
14 | 13 |
|
15 | 14 | jobs: |
16 | 15 | e2e-fleet-test: |
@@ -47,43 +46,28 @@ jobs: |
47 | 46 | uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 |
48 | 47 | with: |
49 | 48 | go-version-file: 'go.mod' |
50 | | - check-latest: true |
51 | 49 | - |
52 | 50 | name: Install Ginkgo CLI |
53 | 51 | run: go install github.com/onsi/ginkgo/v2/ginkgo |
54 | | - - |
55 | | - name: Determine cache key |
56 | | - id: cache-key |
57 | | - run: ./.github/scripts/determine-cache-key.sh |
58 | 52 | - |
59 | 53 | name: Cache crust-gather CLI |
60 | 54 | id: cache-crust |
61 | 55 | uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 |
62 | 56 | with: |
63 | 57 | path: ~/.local/bin/crust-gather |
64 | | - key: ${{ runner.os }}-crust-gather-${{ steps.cache-key.outputs.value }} |
| 58 | + key: ${{ runner.os }}-crust-gather-${{ hashFiles('.github/scripts/install-crust-gather.sh') }} |
65 | 59 | restore-keys: | |
66 | 60 | ${{ runner.os }}-crust-gather- |
67 | 61 | - |
68 | 62 | name: Install crust-gather CLI |
69 | 63 | run: | |
70 | 64 | if [ "${{ steps.cache-crust.outputs.cache-hit }}" != "true" ]; then |
71 | | - echo "Cache not found, downloading from source" |
72 | | - mkdir -p ~/.local/bin |
73 | | - if curl -sSfL https://github.com/crust-gather/crust-gather/raw/main/install.sh | sh -s -- --yes; then |
74 | | - # Cache the binary for future runs |
75 | | - if [ ! -f ~/.local/bin/crust-gather ]; then |
76 | | - which crust-gather && cp $(which crust-gather) ~/.local/bin/ |
77 | | - fi |
78 | | - else |
79 | | - echo "Failed to download crust-gather" |
80 | | - exit 1 |
81 | | - fi |
| 65 | + ./.github/scripts/install-crust-gather.sh |
82 | 66 | else |
83 | 67 | echo "Using cached crust-gather CLI" |
84 | 68 | chmod +x ~/.local/bin/crust-gather |
85 | | - sudo ln -sf ~/.local/bin/crust-gather /usr/local/bin/ |
86 | 69 | fi |
| 70 | + echo "$HOME/.local/bin" >> "$GITHUB_PATH" |
87 | 71 | - |
88 | 72 | name: Build Fleet |
89 | 73 | run: | |
|
99 | 83 | cd e2e/assets/gitrepo |
100 | 84 | # Buildkit needed here for proper here-document support |
101 | 85 | DOCKER_BUILDKIT=1 docker build -f Dockerfile.gitserver -t nginx-git:test --build-arg="passwd=$(openssl passwd foo)" . |
| 86 | + - |
| 87 | + name: Cache k3d CLI |
| 88 | + id: cache-k3d |
| 89 | + uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 |
| 90 | + with: |
| 91 | + path: ~/.local/bin/k3d |
| 92 | + key: ${{ runner.os }}-k3d-${{ hashFiles('.github/scripts/install-k3d.sh') }} |
| 93 | + restore-keys: | |
| 94 | + ${{ runner.os }}-k3d- |
102 | 95 | - |
103 | 96 | name: Install k3d |
104 | | - run: curl --silent --fail https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | TAG=${{ env.SETUP_K3D_VERSION }} bash |
| 97 | + run: | |
| 98 | + if [ "${{ steps.cache-k3d.outputs.cache-hit }}" != "true" ]; then |
| 99 | + ./.github/scripts/install-k3d.sh |
| 100 | + else |
| 101 | + echo "Using cached k3d" |
| 102 | + chmod +x ~/.local/bin/k3d |
| 103 | + fi |
105 | 104 | - |
106 | 105 | name: Provision k3d Cluster |
107 | 106 | run: | |
@@ -270,7 +269,7 @@ jobs: |
270 | 269 | ginkgo --github-output --trace e2e/require-secrets |
271 | 270 | - |
272 | 271 | name: Upload Logs |
273 | | - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 |
| 272 | + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 |
274 | 273 | if: failure() |
275 | 274 | with: |
276 | 275 | name: gha-fleet-e2e-logs-${{ github.sha }}-${{ matrix.k3s.version }}-${{ matrix.test_type.name }}-${{ github.run_id }} |
|
0 commit comments