Skip to content

Commit

Permalink
ci: set golang cache key as **/go.sum glob
Browse files Browse the repository at this point in the history
This should speed up all go builds somewhat, since after reorganizing
the repo, the cache that is set up by setup-go has not been working
anymore:

```
Restore cache failed: Dependencies file is not found in
/home/runner/work/cloud-api-adaptor/cloud-api-adaptor.
```

drive-by fix: remove unnecessary go setup from az oci image build

Signed-off-by: Magnus Kulke <[email protected]>
  • Loading branch information
mkulke committed Oct 23, 2024
1 parent aab207c commit ea3dd1e
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 15 deletions.
18 changes: 3 additions & 15 deletions .github/workflows/azure-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,6 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Extract go version number
run: echo "GO_VERSION=$(yq -e '.tools.golang' versions.yaml)" >> "$GITHUB_ENV"

- name: Set up Go environment
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: go.sum

- uses: azure/login@v2
name: 'Az CLI login'
with:
Expand All @@ -60,11 +51,6 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Install build dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y libvirt-dev
- name: Build container image
id: build-container
env:
Expand Down Expand Up @@ -104,7 +90,8 @@ jobs:
- name: Set up Go environment
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version: "${{ env.GO_VERSION }}"
cache-dependency-path: "**/go.sum"

- name: Set Provisioner Environment Variables
run: |
Expand Down Expand Up @@ -190,6 +177,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: "**/go.sum"

- name: Install cidr calculator
run: |
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: "**/go.sum"
- name: Install build dependencies
if: matrix.type == 'dev'
run: |
Expand Down Expand Up @@ -91,6 +92,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: "**/go.sum"

- name: Install build dependencies
if: matrix.controller == 'peerpod-ctrl'
Expand Down Expand Up @@ -135,6 +137,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: "**/go.sum"

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand Down Expand Up @@ -181,6 +184,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: "**/go.sum"

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/caa_build_and_push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: "**/go.sum"

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Install build dependencies
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/caa_build_and_push_per_arch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: "**/go.sum"

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/csi_wrapper_images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: "**/go.sum"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to quay Container Registry
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/e2e_libvirt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: "**/go.sum"

- name: Setup docker
run: |
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: "**/go.sum"
- name: Install dependencies
run: |
sudo apt-get update -y
Expand All @@ -56,6 +57,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: "**/go.sum"
- name: Install dependencies
run: |
sudo apt-get update -y
Expand Down Expand Up @@ -97,6 +99,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: "**/go.sum"
- name: Go tidy check
run: make tidy-check

Expand All @@ -115,6 +118,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: "**/go.sum"
- name: Install dependencies
run: |
sudo apt-get update -y
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/webhook_image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: "**/go.sum"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to quay Container Registry
Expand Down

0 comments on commit ea3dd1e

Please sign in to comment.