Skip to content

Commit

Permalink
Add go caching in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacome committed Nov 18, 2021
1 parent fea8b93 commit 29a201d
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ jobs:
access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout Repository
uses: actions/checkout@v2
- name: Cache Go controller tools
uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-tools-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-tools-
- name: Output Variables
id: vars
run: |
Expand Down Expand Up @@ -77,6 +86,15 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Cache Go build
uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-build-
- name: Setup Golang Environment
uses: actions/setup-go@v2
with:
Expand All @@ -102,6 +120,15 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Cache Go tests
uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-tests-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-tests-
- name: Setup Golang Environment
uses: actions/setup-go@v2
with:
Expand Down Expand Up @@ -219,6 +246,15 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Cache Go build
uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-build-
- name: Setup Golang Environment
uses: actions/setup-go@v2
with:
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/update-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ jobs:
with:
fetch-depth: 0
ref: refs/tags/v${{ needs.variables.outputs.kic-tag }}
- name: Cache Go build
uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-build-
- name: Setup Golang Environment
uses: actions/setup-go@v2
with:
Expand Down

0 comments on commit 29a201d

Please sign in to comment.