forked from opendatahub-io/kserve
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Upgrade Go to v1.21 (kserve#3296)
Signed-off-by: Yuan Tang <[email protected]>
- Loading branch information
1 parent
6d71f79
commit 9fad9f4
Showing
11 changed files
with
165 additions
and
18 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
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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: "Verify Generated Code" | ||
|
||
on: | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
verify-codegen: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.21 | ||
|
||
- name: Checkout source code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install dependencies | ||
run: | | ||
go mod download | ||
- name: Update Codegen | ||
shell: bash | ||
run: | | ||
GOPATH=$(go env GOPATH) | ||
KSERVE_PATH=$GOPATH/src/github.com/kserve/kserve | ||
echo "KSERVE_PATH=$KSERVE_PATH" >> "$GITHUB_ENV" | ||
mkdir -p $KSERVE_PATH | ||
cp -a . $KSERVE_PATH | ||
cd $KSERVE_PATH | ||
make generate | ||
- name: Verify | ||
shell: bash | ||
run: | | ||
cd $KSERVE_PATH | ||
# From: https://backreference.org/2009/12/23/how-to-match-newlines-in-sed/ | ||
# This is to leverage this workaround: | ||
# https://github.com/actions/toolkit/issues/193#issuecomment-605394935 | ||
urlencode() { | ||
sed ':begin;$!N;s/\n/%0A/;tbegin' | ||
} | ||
# When running make generate, it introduces some lint errors which is fixed manually. | ||
# Reset these files to avoid false triggers due to those changes. | ||
git checkout -- python/kserve/test/__init__.py python/kserve/kserve/api_client.py | ||
if [ -z "$(git status --porcelain ./pkg ./python)" ]; then | ||
echo "${{ github.repository }} up to date." | ||
else | ||
echo "Found diffs in: $(git diff-index --name-only HEAD -- ./pkg ./python)" | ||
for x in $(git diff-index --name-only HEAD -- ./pkg ./python); do | ||
echo "::error file=$x::Please run make generate.%0A$(git diff $x | urlencode)" | ||
done | ||
echo "${{ github.repository }} is out of date. Please run make generate" | ||
exit 1 | ||
fi |
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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module github.com/kserve/kserve | ||
|
||
go 1.20 | ||
go 1.21 | ||
|
||
require ( | ||
cloud.google.com/go/storage v1.30.1 | ||
|
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
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