Skip to content

Commit

Permalink
add go cache to github runner
Browse files Browse the repository at this point in the history
Signed-off-by: JooYoung Park <jooyoung.park73@gmail.com>
  • Loading branch information
JooyoungPark73 committed Apr 22, 2024
1 parent 28fbb7a commit cd4c204
Show file tree
Hide file tree
Showing 10 changed files with 195 additions and 73 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,26 @@ jobs:
runs-on: ubuntu-20.04
steps:

- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
# to add commit DCO checks later
fetch-depth: 21

- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}

- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Cache Go Modules and Build Cache
uses: actions/cache@v3
with:
# to add commit DCO checks later
fetch-depth: 21
path: |
/home/runner/go/pkg/mod
/home/runner/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Check code
uses: golangci/golangci-lint-action@v4.0.0
Expand Down
20 changes: 16 additions & 4 deletions .github/workflows/build_setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,25 @@ jobs:
name: Build setup scripts
runs-on: ubuntu-20.04
steps:
- name: Set up Go 1.21

- name: Check out the code
uses: actions/checkout@v4

- name: Set up Go version in go.mod file
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version-file: ${{ github.workspace }}/go.mod
cache-dependency-path: ${{ github.workspace }}/go.sum

- name: Check out the code
uses: actions/checkout@v4
- name: Cache Go Modules and Build Cache
uses: actions/cache@v3
with:
path: |
/home/runner/go/pkg/mod
/home/runner/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build scripts
run: pushd scripts && go build -o setup_tool && popd
Expand Down
19 changes: 15 additions & 4 deletions .github/workflows/cri_minio_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,25 @@ jobs:
steps:
- name: Setup TMPDIR
run: mkdir -p $TMPDIR

- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Set up Go 1.21
- name: Set up Go version in go.mod file
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version-file: ${{ github.workspace }}/go.mod
cache-dependency-path: ${{ github.workspace }}/go.sum

- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Cache Go Modules and Build Cache
uses: actions/cache@v3
with:
path: |
/home/runner/go/pkg/mod
/home/runner/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build
run: go build
Expand Down
15 changes: 13 additions & 2 deletions .github/workflows/cri_stock_containerd_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,21 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Set up golang
- name: Set up Go version in go.mod file
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version-file: ${{ github.workspace }}/go.mod
cache-dependency-path: ${{ github.workspace }}/go.sum

- name: Cache Go Modules and Build Cache
uses: actions/cache@v3
with:
path: |
/home/runner/go/pkg/mod
/home/runner/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build setup scripts
run: pushd scripts && go build -o setup_tool && popd
Expand Down
15 changes: 13 additions & 2 deletions .github/workflows/cri_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,21 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up golang
- name: Set up Go version in go.mod file
uses: actions/setup-go@v5
with:
go-version: "1.21"
go-version-file: ${{ github.workspace }}/go.mod
cache-dependency-path: ${{ github.workspace }}/go.sum

- name: Cache Go Modules and Build Cache
uses: actions/cache@v3
with:
path: |
/home/runner/go/pkg/mod
/home/runner/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Add rsync
run: |
Expand Down
31 changes: 18 additions & 13 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,32 +30,37 @@ jobs:
matrix:
test-name: [test, test-man-bench]
steps:

- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
lfs: true

- name: Set up Go 1.21
- name: Set up Go version in go.mod file
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version-file: ${{ github.workspace }}/go.mod
cache-dependency-path: ${{ github.workspace }}/go.sum

- name: Cache Go Modules and Build Cache
uses: actions/cache@v3
with:
path: |
/home/runner/go/pkg/mod
/home/runner/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Set up Python 3.x
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Upgrade git
run: |
sudo add-apt-repository ppa:git-core/ppa -y
sudo apt update
sudo apt install git -y

- name: Add rsync
run: |
sudo apt update
sudo apt install rsync -y
- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
lfs: true
- name: Build setup scripts
run: pushd scripts && go build -o setup_tool && popd
Expand Down
46 changes: 31 additions & 15 deletions .github/workflows/nightly_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,27 @@ jobs:
steps:
- name: Setup TMPDIR
run: mkdir -p $TMPDIR

- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
lfs: true

- name: Set up Go 1.21
- name: Set up Go version in go.mod file
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version-file: ${{ github.workspace }}/go.mod
cache-dependency-path: ${{ github.workspace }}/go.sum

- name: Upgrade git
run: |
sudo add-apt-repository ppa:git-core/ppa -y
sudo apt update
sudo apt install git -y
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Cache Go Modules and Build Cache
uses: actions/cache@v3
with:
lfs: true
path: |
/home/runner/go/pkg/mod
/home/runner/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build setup scripts
run: pushd scripts && go build -o setup_tool && popd
Expand Down Expand Up @@ -77,13 +82,24 @@ jobs:
- name: Setup TMPDIR
run: mkdir -p $TMPDIR

- name: Set up Go 1.21
- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Set up Go version in go.mod file
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version-file: ${{ github.workspace }}/go.mod
cache-dependency-path: ${{ github.workspace }}/go.sum

- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Cache Go Modules and Build Cache
uses: actions/cache@v3
with:
path: |
/home/runner/go/pkg/mod
/home/runner/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build setup scripts
run: pushd scripts && go build -o setup_tool && popd
Expand Down
19 changes: 15 additions & 4 deletions .github/workflows/openyurt-unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,24 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Set up Go 1.21
- name: Check out the code
uses: actions/checkout@v4

- name: Set up Go version in go.mod file
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version-file: ${{ github.workspace }}/go.mod
cache-dependency-path: ${{ github.workspace }}/go.sum

- name: Check out the code
uses: actions/checkout@v4
- name: Cache Go Modules and Build Cache
uses: actions/cache@v3
with:
path: |
/home/runner/go/pkg/mod
/home/runner/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build scripts
run:
Expand Down
15 changes: 13 additions & 2 deletions .github/workflows/stargz_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,21 @@ jobs:
- name: Checkout LFS objects
run: git lfs checkout

- name: Set up Go 1.21
- name: Set up Go version in go.mod file
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version-file: ${{ github.workspace }}/go.mod
cache-dependency-path: ${{ github.workspace }}/go.sum

- name: Cache Go Modules and Build Cache
uses: actions/cache@v3
with:
path: |
/home/runner/go/pkg/mod
/home/runner/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build setup scripts
run: pushd scripts && go build -o setup_tool && popd
Expand Down

0 comments on commit cd4c204

Please sign in to comment.