-
Notifications
You must be signed in to change notification settings - Fork 450
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
base: rebuild go binary deps from source (#4524)
Signed-off-by: zhangzujian <[email protected]>
- Loading branch information
1 parent
7785784
commit 4705dd5
Showing
7 changed files
with
215 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,6 @@ concurrency: | |
cancel-in-progress: true | ||
|
||
env: | ||
GO_VERSION: '' | ||
GOSEC_VERSION: '2.19.0' | ||
HELM_VERSION: v3.11.1 | ||
|
||
|
@@ -59,9 +58,19 @@ jobs: | |
- uses: docker/setup-buildx-action@v3 | ||
if: steps.check.outputs.buildx == 1 | ||
|
||
- name: Build | ||
- uses: actions/setup-go@v5 | ||
if: steps.check.outputs.buildx == 1 | ||
id: setup-go | ||
with: | ||
go-version-file: go.mod | ||
check-latest: true | ||
cache: false | ||
|
||
- name: Build kube-ovn-base image | ||
id: build | ||
if: steps.check.outputs.buildx == 1 | ||
env: | ||
GO_VERSION: ${{ steps.setup-go.outputs.go-version }} | ||
run: | | ||
if git diff --name-only HEAD^ HEAD | grep -q ^dist/images/Dockerfile.base$; then | ||
make base-amd64 | ||
|
@@ -95,25 +104,25 @@ jobs: | |
- uses: actions/checkout@v4 | ||
- uses: docker/setup-buildx-action@v3 | ||
- uses: actions/setup-go@v5 | ||
id: setup-go | ||
with: | ||
go-version: ${{ env.GO_VERSION || '' }} | ||
go-version-file: go.mod | ||
check-latest: true | ||
cache: false | ||
|
||
- name: Setup environment variables | ||
run: | | ||
echo "TAG=$(cat VERSION)" >> "$GITHUB_ENV" | ||
echo "GO_FULL_VER=$(go env GOVERSION)" >> "$GITHUB_ENV" | ||
echo "GO_VERSION=${{ steps.setup-go.outputs.go-version }}" >> "$GITHUB_ENV" | ||
- name: Go cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.cache/go-build | ||
~/go/pkg/mod | ||
key: ${{ runner.os }}-${{ env.GO_FULL_VER }}-x86-${{ hashFiles('**/go.sum') }} | ||
restore-keys: ${{ runner.os }}-${{ env.GO_FULL_VER }}-x86- | ||
key: ${{ runner.os }}-go-${{ env.GO_VERSION }}-x86-${{ hashFiles('**/go.sum') }} | ||
restore-keys: ${{ runner.os }}-go-${{ env.GO_VERSION }}-x86- | ||
|
||
- name: Unit test | ||
run: | | ||
|
@@ -285,14 +294,14 @@ jobs: | |
fi | ||
- uses: actions/setup-go@v5 | ||
id: setup-go | ||
with: | ||
go-version: ${{ env.GO_VERSION || '' }} | ||
go-version-file: ${{ env.E2E_DIR }}/go.mod | ||
check-latest: true | ||
cache: false | ||
|
||
- name: Export Go full version | ||
run: echo "GO_FULL_VER=$(go env GOVERSION)" >> "$GITHUB_ENV" | ||
run: echo "GO_VERSION=${{ steps.setup-go.outputs.go-version }}" >> "$GITHUB_ENV" | ||
|
||
- name: Lookup Go cache | ||
id: lookup-go-cache | ||
|
@@ -301,8 +310,8 @@ jobs: | |
path: | | ||
~/.cache/go-build | ||
~/go/pkg/mod | ||
key: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} | ||
restore-keys: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86- | ||
key: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} | ||
restore-keys: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86- | ||
lookup-only: true | ||
|
||
- uses: jlumbroso/[email protected] | ||
|
@@ -323,8 +332,8 @@ jobs: | |
path: | | ||
~/.cache/go-build | ||
~/go/pkg/mod | ||
key: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} | ||
restore-keys: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86- | ||
key: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} | ||
restore-keys: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86- | ||
|
||
- name: Install ginkgo | ||
if: steps.lookup-go-cache.outputs.cache-hit != 'true' | ||
|
@@ -344,8 +353,8 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
id: setup-go | ||
with: | ||
go-version: ${{ env.GO_VERSION || '' }} | ||
go-version-file: go.mod | ||
check-latest: true | ||
cache: false | ||
|
@@ -426,23 +435,23 @@ jobs: | |
sudo systemctl restart docker | ||
- uses: actions/setup-go@v5 | ||
id: setup-go | ||
with: | ||
go-version: ${{ env.GO_VERSION || '' }} | ||
go-version-file: ${{ env.E2E_DIR }}/go.mod | ||
check-latest: true | ||
cache: false | ||
|
||
- name: Export Go full version | ||
run: echo "GO_FULL_VER=$(go env GOVERSION)" >> "$GITHUB_ENV" | ||
run: echo "GO_VERSION=${{ steps.setup-go.outputs.go-version }}" >> "$GITHUB_ENV" | ||
|
||
- name: Go cache | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: | | ||
~/.cache/go-build | ||
~/go/pkg/mod | ||
key: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} | ||
restore-keys: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86- | ||
key: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} | ||
restore-keys: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86- | ||
|
||
- name: Install kind | ||
uses: helm/kind-action@v1 | ||
|
@@ -574,23 +583,23 @@ jobs: | |
sudo systemctl restart docker | ||
- uses: actions/setup-go@v5 | ||
id: setup-go | ||
with: | ||
go-version: ${{ env.GO_VERSION || '' }} | ||
go-version-file: ${{ env.E2E_DIR }}/go.mod | ||
check-latest: true | ||
cache: false | ||
|
||
- name: Export Go full version | ||
run: echo "GO_FULL_VER=$(go env GOVERSION)" >> "$GITHUB_ENV" | ||
run: echo "GO_VERSION=${{ steps.setup-go.outputs.go-version }}" >> "$GITHUB_ENV" | ||
|
||
- name: Go cache | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: | | ||
~/.cache/go-build | ||
~/go/pkg/mod | ||
key: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} | ||
restore-keys: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86- | ||
key: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} | ||
restore-keys: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86- | ||
|
||
- name: Install kind | ||
uses: helm/kind-action@v1 | ||
|
@@ -732,22 +741,21 @@ jobs: | |
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ env.GO_VERSION || '' }} | ||
go-version-file: ${{ env.E2E_DIR }}/go.mod | ||
check-latest: true | ||
cache: false | ||
|
||
- name: Export Go full version | ||
run: echo "GO_FULL_VER=$(go env GOVERSION)" >> "$GITHUB_ENV" | ||
run: echo "GO_VERSION=${{ steps.setup-go.outputs.go-version }}" >> "$GITHUB_ENV" | ||
|
||
- name: Go cache | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: | | ||
~/.cache/go-build | ||
~/go/pkg/mod | ||
key: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} | ||
restore-keys: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86- | ||
key: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} | ||
restore-keys: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86- | ||
|
||
- name: Install kind | ||
uses: helm/kind-action@v1 | ||
|
@@ -1013,23 +1021,23 @@ jobs: | |
fi | ||
- uses: actions/setup-go@v5 | ||
id: setup-go | ||
with: | ||
go-version: ${{ env.GO_VERSION || '' }} | ||
go-version-file: ${{ env.E2E_DIR }}/go.mod | ||
check-latest: true | ||
cache: false | ||
|
||
- name: Export Go full version | ||
run: echo "GO_FULL_VER=$(go env GOVERSION)" >> "$GITHUB_ENV" | ||
run: echo "GO_VERSION=${{ steps.setup-go.outputs.go-version }}" >> "$GITHUB_ENV" | ||
|
||
- name: Go cache | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: | | ||
~/.cache/go-build | ||
~/go/pkg/mod | ||
key: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} | ||
restore-keys: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86- | ||
key: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} | ||
restore-keys: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86- | ||
|
||
- name: Install kind | ||
uses: helm/kind-action@v1 | ||
|
@@ -1151,23 +1159,23 @@ jobs: | |
fi | ||
- uses: actions/setup-go@v5 | ||
id: setup-go | ||
with: | ||
go-version: ${{ env.GO_VERSION || '' }} | ||
go-version-file: ${{ env.E2E_DIR }}/go.mod | ||
check-latest: true | ||
cache: false | ||
|
||
- name: Export Go full version | ||
run: echo "GO_FULL_VER=$(go env GOVERSION)" >> "$GITHUB_ENV" | ||
run: echo "GO_VERSION=${{ steps.setup-go.outputs.go-version }}" >> "$GITHUB_ENV" | ||
|
||
- name: Go cache | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: | | ||
~/.cache/go-build | ||
~/go/pkg/mod | ||
key: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} | ||
restore-keys: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86- | ||
key: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} | ||
restore-keys: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86- | ||
|
||
- name: Install kind | ||
uses: helm/kind-action@v1 | ||
|
@@ -1432,23 +1440,23 @@ jobs: | |
fi | ||
- uses: actions/setup-go@v5 | ||
id: setup-go | ||
with: | ||
go-version: ${{ env.GO_VERSION || '' }} | ||
go-version-file: ${{ env.E2E_DIR }}/go.mod | ||
check-latest: true | ||
cache: false | ||
|
||
- name: Export Go full version | ||
run: echo "GO_FULL_VER=$(go env GOVERSION)" >> "$GITHUB_ENV" | ||
run: echo "GO_VERSION=${{ steps.setup-go.outputs.go-version }}" >> "$GITHUB_ENV" | ||
|
||
- name: Go cache | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: | | ||
~/.cache/go-build | ||
~/go/pkg/mod | ||
key: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} | ||
restore-keys: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86- | ||
key: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} | ||
restore-keys: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86- | ||
|
||
- name: Install kind | ||
uses: helm/kind-action@v1 | ||
|
@@ -1587,23 +1595,23 @@ jobs: | |
sudo systemctl restart docker | ||
- uses: actions/setup-go@v5 | ||
id: setup-go | ||
with: | ||
go-version: ${{ env.GO_VERSION || '' }} | ||
go-version-file: ${{ env.E2E_DIR }}/go.mod | ||
check-latest: true | ||
cache: false | ||
|
||
- name: Export Go full version | ||
run: echo "GO_FULL_VER=$(go env GOVERSION)" >> "$GITHUB_ENV" | ||
run: echo "GO_VERSION=${{ steps.setup-go.outputs.go-version }}" >> "$GITHUB_ENV" | ||
|
||
- name: Go cache | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: | | ||
~/.cache/go-build | ||
~/go/pkg/mod | ||
key: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} | ||
restore-keys: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86- | ||
key: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} | ||
restore-keys: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86- | ||
|
||
- name: Install kind | ||
uses: helm/kind-action@v1 | ||
|
@@ -1697,23 +1705,23 @@ jobs: | |
fi | ||
- uses: actions/setup-go@v5 | ||
id: setup-go | ||
with: | ||
go-version: ${{ env.GO_VERSION || '' }} | ||
go-version-file: ${{ env.E2E_DIR }}/go.mod | ||
check-latest: true | ||
cache: false | ||
|
||
- name: Export Go full version | ||
run: echo "GO_FULL_VER=$(go env GOVERSION)" >> "$GITHUB_ENV" | ||
run: echo "GO_VERSION=${{ steps.setup-go.outputs.go-version }}" >> "$GITHUB_ENV" | ||
|
||
- name: Go cache | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: | | ||
~/.cache/go-build | ||
~/go/pkg/mod | ||
key: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} | ||
restore-keys: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86- | ||
key: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86-${{ hashFiles(format('{0}/**/go.sum', env.E2E_DIR)) }} | ||
restore-keys: ${{ runner.os }}-e2e-go-${{ env.GO_VERSION }}-x86- | ||
|
||
- name: Install kind | ||
uses: helm/kind-action@v1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.