Skip to content

Commit

Permalink
chore: fix checkout and setup-go ordering to optimize cache usage (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
remyleone authored Aug 2, 2024
1 parent 60142d6 commit f4c1887
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ jobs:
platform: [ ubuntu-latest ]
runs-on: ${{ matrix.platform }}
steps:
# Checkout should always be before setup-go to ensure caching is working
- name: Checkout
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Checkout
uses: actions/checkout@v4
- name: Install plugin
run: make install-plugin
- name: Build binaries
Expand Down
25 changes: 19 additions & 6 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,20 @@ jobs:
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
# Checkout should always be before setup-go to ensure caching is working
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Checkout
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v3
with:
fetch-depth: 1
go-version: ${{ matrix.go-version }}
- name: Build binaries
run: make build
- name: Run unit tests
Expand All @@ -32,13 +38,20 @@ jobs:
platform: [ ubuntu-latest ]
runs-on: ${{ matrix.platform }}
steps:
# Checkout should always be before setup-go to ensure caching is working
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Checkout
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v3
with:
fetch-depth: 1
go-version: ${{ matrix.go-version }}
- name: Generate
run: make generate

0 comments on commit f4c1887

Please sign in to comment.