Skip to content

Commit

Permalink
action: update setup-go to v4 and enabled caching
Browse files Browse the repository at this point in the history
When update setup-go to v4, it can cache by itself. And select go version
by `go.work`.

Signed-off-by: Yadong Ding <ding_yadong@foxmail.com>
  • Loading branch information
Desiki-high authored and imeoer committed Dec 1, 2023
1 parent 40489c7 commit a1ad70a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 42 deletions.
14 changes: 3 additions & 11 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Golang
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ~1.20
- name: Golang Cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-golang-
go-version-file: 'go.work'
cache-dependency-path: "**/*.sum"
- name: Build Contrib
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/local/bin v1.51.2
Expand Down
14 changes: 3 additions & 11 deletions .github/workflows/convert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Golang
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ~1.20
- name: Golang Cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-golang-
go-version-file: 'go.work'
cache-dependency-path: "**/*.sum"
- name: Build Contrib
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/local/bin v1.51.2
Expand Down
13 changes: 4 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,11 @@ jobs:
DOCKER: false
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- name: Setup Golang
uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: cache go mod
uses: actions/cache@v3
with:
path: /go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/contrib/nydusify/go.sum', '**/contrib/ctr-remote/go.sum', '**/contrib/nydus-overlayfs/go.sum') }}
restore-keys: |
${{ runner.os }}-go
go-version-file: 'go.work'
cache-dependency-path: "**/*.sum"
- name: build contrib go components
run: |
make -e GOARCH=${{ matrix.arch }} contrib-release
Expand Down
14 changes: 3 additions & 11 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Golang
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ~1.20
- name: Golang Cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-golang-
go-version-file: 'go.work'
cache-dependency-path: "**/*.sum"
- name: Build Contrib
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/bin v1.51.2
Expand Down

0 comments on commit a1ad70a

Please sign in to comment.