-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: make presubmit check workflow work
Signed-off-by: jwcesign <[email protected]>
- Loading branch information
Showing
18 changed files
with
209 additions
and
1,632 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Pre-submit check | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: {} | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: read | ||
|
||
jobs: | ||
presubmit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.23' | ||
cache: false | ||
|
||
- name: Install toolchain | ||
run: | | ||
make toolchain | ||
- name: Presubmit check | ||
run: | | ||
make presubmit |
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
768 changes: 37 additions & 731 deletions
768
config/components/crds/karpenter.k8s.alicloud_ecsnodeclasses.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
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,15 @@ | ||
/* | ||
Copyright 2024 The CloudPilot AI Authors. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ |
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 |
---|---|---|
|
@@ -10,21 +10,22 @@ main() { | |
} | ||
|
||
tools() { | ||
go install github.com/google/go-licenses@latest | ||
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest | ||
go install github.com/google/ko@latest | ||
go install github.com/mikefarah/yq/v4@latest | ||
go install github.com/norwoodj/helm-docs/cmd/helm-docs@latest | ||
go install github.com/google/go-licenses@v1.6.0 | ||
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.60.3 | ||
go install github.com/google/ko@v0.16.0 | ||
go install github.com/mikefarah/yq/v4@v4.44.3 | ||
go install github.com/norwoodj/helm-docs/cmd/helm-docs@v1.14.2 | ||
go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest | ||
go install sigs.k8s.io/controller-tools/cmd/controller-gen@latest | ||
go install github.com/sigstore/cosign/v2/cmd/cosign@latest | ||
go install -tags extended github.com/gohugoio/[email protected] | ||
go install golang.org/x/vuln/cmd/govulncheck@latest | ||
go install github.com/onsi/ginkgo/v2/ginkgo@latest | ||
go install github.com/rhysd/actionlint/cmd/actionlint@latest | ||
go install github.com/mattn/goveralls@latest | ||
go install github.com/onsi/ginkgo/v2/ginkgo@v2.20.2 | ||
go install github.com/rhysd/actionlint/cmd/actionlint@v1.7.2 | ||
go install github.com/mattn/goveralls@v0.0.12 | ||
go install github.com/google/go-containerregistry/cmd/crane@latest | ||
go install oras.land/oras/cmd/oras@latest | ||
go install oras.land/oras/cmd/[email protected] | ||
go install k8s.io/code-generator/cmd/[email protected] | ||
|
||
if ! echo "$PATH" | grep -q "${GOPATH:-undefined}/bin\|$HOME/go/bin"; then | ||
echo "Go workspace's \"bin\" directory is not in PATH. Run 'export PATH=\"\$PATH:\${GOPATH:-\$HOME/go}/bin\"'." | ||
|
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,35 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eu -o pipefail | ||
|
||
# Update CRD | ||
controller-gen crd paths=./pkg/apis/v1alpha1/... output:crd:dir=./config/components/crds | ||
|
||
# Update generated code | ||
export REPO_ROOT=$(pwd) | ||
export GOPATH="${REPO_ROOT}/_go" | ||
|
||
cleanup() { | ||
# TODO: In github action, it needs root privilege to delete this dir | ||
sudo rm -rf "${GOPATH}" | ||
} | ||
trap "cleanup" EXIT SIGINT | ||
|
||
echo $REPO_ROOT | ||
echo $GOPATH | ||
|
||
KARPENTER_GO_PACKAGE="github.com/cloudpilot-ai/karpenter-provider-alicloud" | ||
GO_PKG_DIR=$(dirname "${GOPATH}/src/${KARPENTER_GO_PACKAGE}") | ||
mkdir -p "${GO_PKG_DIR}" | ||
|
||
echo $KARPENTER_GO_PACKAGE | ||
echo $GO_PKG_DIR | ||
|
||
if [[ ! -e "${GO_PKG_DIR}" || "$(readlink "${GO_PKG_DIR}")" != "${REPO_ROOT}" ]]; then | ||
ln -snf "${REPO_ROOT}" "${GO_PKG_DIR}" | ||
fi | ||
|
||
deepcopy-gen \ | ||
--go-header-file hack/boilerplate.go.txt \ | ||
--output-file-base zz_generated.deepcopy \ | ||
--input-dirs github.com/cloudpilot-ai/karpenter-provider-alicloud/pkg/apis/v1alpha1 |
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,37 @@ | ||
/* | ||
Copyright 2024 The CloudPilot AI Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
// +k8s:openapi-gen=true | ||
// +k8s:deepcopy-gen=package,register | ||
// +groupName=karpenter.k8s.alicloud | ||
package v1alpha1 | ||
|
||
import ( | ||
corev1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
"k8s.io/apimachinery/pkg/runtime/schema" | ||
"k8s.io/client-go/kubernetes/scheme" | ||
|
||
"github.com/cloudpilot-ai/karpenter-provider-alicloud/pkg/apis" | ||
) | ||
|
||
func init() { | ||
gv := schema.GroupVersion{Group: apis.Group, Version: "v1"} | ||
corev1.AddToGroupVersion(scheme.Scheme, gv) | ||
scheme.Scheme.AddKnownTypes(gv, | ||
&ECSNodeClass{}, | ||
&ECSNodeClassList{}, | ||
) | ||
} |
Oops, something went wrong.