Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
8f777d04
Unverified
Commit
8f777d04
authored
Mar 01, 2024
by
Derek Nola
Committed by
GitHub
Mar 01, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better GitHub CI caching strategy for golang (#9495)
Signed-off-by:
Derek Nola
<
derek.nola@suse.com
>
parent
736fb2bc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
13 deletions
+31
-13
actions.yaml
.github/actions/setup-go/actions.yaml
+28
-0
integration.yaml
.github/workflows/integration.yaml
+1
-8
unitcoverage.yaml
.github/workflows/unitcoverage.yaml
+1
-4
updatecli.yaml
.github/workflows/updatecli.yaml
+1
-1
No files found.
.github/actions/setup-go/actions.yaml
0 → 100644
View file @
8f777d04
name
:
'
Setup
golang
with
master
only
caching'
description
:
'
A
composite
action
that
installs
golang,
but
with
a
caching
strategy
that
only
updates
the
cache
on
master
branch.'
runs
:
using
:
'
composite'
steps
:
-
uses
:
actions/setup-go@v5
with
:
go-version-file
:
'
go.mod'
# Just use whatever version is in the go.mod file
cache
:
${{ github.ref == 'refs/heads/master' }}
-
name
:
Prepare for go cache
if
:
${{ github.ref != 'refs/heads/master' }}
run
:
|
echo "GO_CACHE=$(go env GOCACHE)" | tee -a "$GITHUB_ENV"
echo "GO_MODCACHE=$(go env GOMODCACHE)" | tee -a "$GITHUB_ENV"
echo "GO_VERSION=$(go env GOVERSION | tr -d 'go')" | tee -a "$GITHUB_ENV"
-
name
:
Setup read-only cache
if
:
${{ github.ref != 'refs/heads/master' }}
uses
:
actions/cache/restore@v4
with
:
path
:
|
${{ env.GO_MODCACHE }}
${{ env.GO_CACHE }}
key
:
setup-go-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ hashFiles('go.sum') }}
restore-keys
:
|
setup-go-${{ runner.os }}-
\ No newline at end of file
.github/workflows/integration.yaml
View file @
8f777d04
...
@@ -46,14 +46,7 @@ jobs:
...
@@ -46,14 +46,7 @@ jobs:
with
:
with
:
fetch-depth
:
1
fetch-depth
:
1
-
name
:
Install Go
-
name
:
Install Go
uses
:
actions/setup-go@v5
uses
:
.github/actions/setup-go
with
:
go-version
:
'
1.21.7'
check-latest
:
true
cache
:
true
cache-dependency-path
:
|
**/go.sum
**/go.mod
-
name
:
"
Download
k3s
binary"
-
name
:
"
Download
k3s
binary"
uses
:
actions/download-artifact@v3
uses
:
actions/download-artifact@v3
with
:
with
:
...
...
.github/workflows/unitcoverage.yaml
View file @
8f777d04
...
@@ -36,10 +36,7 @@ jobs:
...
@@ -36,10 +36,7 @@ jobs:
with
:
with
:
fetch-depth
:
1
fetch-depth
:
1
-
name
:
Install Go
-
name
:
Install Go
uses
:
actions/setup-go@v5
uses
:
.github/actions/setup-go
with
:
go-version-file
:
go.mod
# Just use whatever version is in the go.mod file
check-latest
:
true
-
name
:
Run Unit Tests
-
name
:
Run Unit Tests
run
:
|
run
:
|
go test -coverpkg=./... -coverprofile=coverage.out ./pkg/... -run Unit
go test -coverpkg=./... -coverprofile=coverage.out ./pkg/... -run Unit
...
...
.github/workflows/updatecli.yaml
View file @
8f777d04
...
@@ -26,7 +26,7 @@ jobs:
...
@@ -26,7 +26,7 @@ jobs:
uses
:
actions/setup-go@v5
uses
:
actions/setup-go@v5
with
:
with
:
go-version
:
'
stable'
go-version
:
'
stable'
cache
:
false
-
name
:
Delete leftover UpdateCLI branches
-
name
:
Delete leftover UpdateCLI branches
run
:
|
run
:
|
gh pr list --search "is:closed is:pr head:updatecli_" --json headRefName --jq ".[].headRefName" | sort -u > closed_prs_branches.txt
gh pr list --search "is:closed is:pr head:updatecli_" --json headRefName --jq ".[].headRefName" | sort -u > closed_prs_branches.txt
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment