diff --git a/.github/actions/deploy-chaos-mesh/action.yaml b/.github/actions/deploy-chaos-mesh/action.yaml index 2944e3dc9e..169141e023 100644 --- a/.github/actions/deploy-chaos-mesh/action.yaml +++ b/.github/actions/deploy-chaos-mesh/action.yaml @@ -14,7 +14,7 @@ # limitations under the License. # name: "Deploy Chaos Mesh" -description: "A action to deploy Chaos Mesh" +description: "An action to deploy Chaos Mesh" inputs: chaos_mesh_version: description: "The Chaos Mesh version to use. The default version is `versions/CHAOS_MESH_VERSION`" diff --git a/.github/actions/detect-docker-image-tags/action.yaml b/.github/actions/detect-docker-image-tags/action.yaml index 3e889d360c..fc82ebae47 100644 --- a/.github/actions/detect-docker-image-tags/action.yaml +++ b/.github/actions/detect-docker-image-tags/action.yaml @@ -14,7 +14,7 @@ # limitations under the License. # name: "Detect Docker image tags" -description: "A action to detect Docker image tags" +description: "An action to detect Docker image tags" inputs: tags: description: "Tag name to check whether exists or not" diff --git a/.github/actions/determine-docker-image-tag/action.yaml b/.github/actions/determine-docker-image-tag/action.yaml index 0aa55f2373..e5a0933a1a 100644 --- a/.github/actions/determine-docker-image-tag/action.yaml +++ b/.github/actions/determine-docker-image-tag/action.yaml @@ -14,7 +14,7 @@ # limitations under the License. # name: "Determine Docker image tag" -description: "A action to determine Docker image tag" +description: "An action to determine Docker image tag" outputs: TAGS: description: "docker image tag list" diff --git a/.github/actions/docker-build/action.yaml b/.github/actions/docker-build/action.yaml index 8a152e28ad..13eecaef47 100644 --- a/.github/actions/docker-build/action.yaml +++ b/.github/actions/docker-build/action.yaml @@ -14,7 +14,7 @@ # limitations under the License. # name: "Build Docker images" -description: "A action to build Docker images and publish them" +description: "An action to build Docker images and publish them" inputs: target: description: "Build target" diff --git a/.github/actions/dump-context/action.yaml b/.github/actions/dump-context/action.yaml index a445331014..0995dfc18a 100644 --- a/.github/actions/dump-context/action.yaml +++ b/.github/actions/dump-context/action.yaml @@ -14,7 +14,7 @@ # limitations under the License. # name: "Dump context to log" -description: "A action to dump context to log" +description: "An action to dump context to log" runs: using: "composite" steps: diff --git a/.github/actions/e2e-deploy-vald-helm-operator/action.yaml b/.github/actions/e2e-deploy-vald-helm-operator/action.yaml index 77dd769f0d..a1604c80db 100644 --- a/.github/actions/e2e-deploy-vald-helm-operator/action.yaml +++ b/.github/actions/e2e-deploy-vald-helm-operator/action.yaml @@ -14,7 +14,7 @@ # limitations under the License. # name: "Deploy Vald using vald-helm-operator for E2E test" -description: "A action to deploy vald using vald-helm-operator for E2E test" +description: "An action to deploy vald using vald-helm-operator for E2E test" inputs: require_minio: description: "If Minio is required, set this to true." diff --git a/.github/actions/e2e-deploy-vald-readreplica/action.yaml b/.github/actions/e2e-deploy-vald-readreplica/action.yaml index f306406082..cfcdad536e 100644 --- a/.github/actions/e2e-deploy-vald-readreplica/action.yaml +++ b/.github/actions/e2e-deploy-vald-readreplica/action.yaml @@ -14,7 +14,7 @@ # limitations under the License. # name: "Deploy Vald Read Replica for E2E test" -description: "A action to deploy vald read replica for E2E test" +description: "An action to deploy vald read replica for E2E test" inputs: require_minio: description: "If Minio is required, set this to true." diff --git a/.github/actions/e2e-deploy-vald/action.yaml b/.github/actions/e2e-deploy-vald/action.yaml index 1368f7c1e2..63ffae0742 100644 --- a/.github/actions/e2e-deploy-vald/action.yaml +++ b/.github/actions/e2e-deploy-vald/action.yaml @@ -14,7 +14,7 @@ # limitations under the License. # name: "Deploy Vald for E2E test" -description: "A action to deploy vald for E2E test" +description: "An action to deploy vald for E2E test" inputs: require_minio: description: "If Minio is required, set this to true." diff --git a/.github/actions/notify-slack/action.yaml b/.github/actions/notify-slack/action.yaml index be70528326..e0b92e556c 100644 --- a/.github/actions/notify-slack/action.yaml +++ b/.github/actions/notify-slack/action.yaml @@ -14,7 +14,7 @@ # limitations under the License. # name: "Notify Slack" -description: "A action to notify Slack" +description: "An action to notify Slack" inputs: author_name: description: "User name for slack notification" diff --git a/.github/actions/scan-docker-image/action.yaml b/.github/actions/scan-docker-image/action.yaml index 3c4dc559c7..240ae62be7 100644 --- a/.github/actions/scan-docker-image/action.yaml +++ b/.github/actions/scan-docker-image/action.yaml @@ -14,7 +14,7 @@ # limitations under the License. # name: "Scan the Docker image" -description: "A action to scan the Docker image" +description: "An action to scan the Docker image" inputs: image_ref: description: "Docker image reference" diff --git a/.github/actions/setup-e2e/action.yaml b/.github/actions/setup-e2e/action.yaml index 6cf1745809..52fa1f7330 100644 --- a/.github/actions/setup-e2e/action.yaml +++ b/.github/actions/setup-e2e/action.yaml @@ -14,7 +14,7 @@ # limitations under the License. # name: "Setup E2E environment" -description: "A action to set up the environment for executing E2E test" +description: "An action to set up the environment for executing E2E test" inputs: require_libhdf5: description: "If libhdf5 is not required, set this to false" diff --git a/.github/actions/setup-go/action.yaml b/.github/actions/setup-go/action.yaml index ba3f7ec7e4..b767d59898 100644 --- a/.github/actions/setup-go/action.yaml +++ b/.github/actions/setup-go/action.yaml @@ -14,7 +14,7 @@ # limitations under the License. # name: "Setup Go environment" -description: "A action to set up Go environment" +description: "An action to set up Go environment" inputs: go_version: description: "The Go version to use. The default version is `versions/GO_VERSION`" @@ -28,14 +28,25 @@ runs: shell: bash run: | GO_VERSION=${GO_VERSION:-`make version/go`} - echo "version=${GO_VERSION}" >> $GITHUB_OUTPUT env: GO_VERSION: ${{ inputs.go_version }} - - uses: actions/setup-go@v5 + - name: Check if Go is installed + id: check_go + shell: bash + run: | + if command -v go &> /dev/null; then + echo "go_installed=true" >> $GITHUB_OUTPUT + echo "installed_version=$(go version | awk '{print $3}')" >> $GITHUB_OUTPUT + else + echo "go_installed=false" >> $GITHUB_OUTPUT + fi + - name: Setup Go (if not installed or version mismatch) + if: steps.check_go.outputs.go_installed == 'false' || steps.check_go.outputs.installed_version != steps.go_version.outputs.version + uses: actions/setup-go@v5 with: go-version: ${{ steps.go_version.outputs.version }} - - name: Check Go version + - name: Verify Go version shell: bash run: | go version diff --git a/.github/actions/setup-helm/action.yaml b/.github/actions/setup-helm/action.yaml index 6acdbb0166..f645eb6cf1 100644 --- a/.github/actions/setup-helm/action.yaml +++ b/.github/actions/setup-helm/action.yaml @@ -14,7 +14,7 @@ # limitations under the License. # name: "Setup Helm environment" -description: "A action to set up Helm environment" +description: "An action to set up Helm environment" inputs: helm_version: description: "The Helm version to use. The default version is `versions/HELM_VERSION`" @@ -28,14 +28,25 @@ runs: shell: bash run: | HELM_VERSION=${HELM_VERSION:-`make version/helm`} - echo "version=${HELM_VERSION}" >> $GITHUB_OUTPUT env: HELM_VERSION: ${{ inputs.helm_version }} - - uses: azure/setup-helm@v4 + - name: Check if Helm is installed + id: check_helm + shell: bash + run: | + if command -v helm &> /dev/null; then + echo "helm_installed=true" >> $GITHUB_OUTPUT + echo "installed_version=$(helm version --short --client | awk '{print $2}' | sed 's/^v//')" >> $GITHUB_OUTPUT + else + echo "helm_installed=false" >> $GITHUB_OUTPUT + fi + - name: Setup Helm (if not installed or version mismatch) + if: steps.check_helm.outputs.helm_installed == 'false' || steps.check_helm.outputs.installed_version != steps.helm_version.outputs.version + uses: azure/setup-helm@v4 with: version: ${{ steps.helm_version.outputs.version }} - - name: Check Helm version + - name: Verify Helm version shell: bash run: | - helm version + helm version --short --client diff --git a/.github/actions/setup-k3d/action.yaml b/.github/actions/setup-k3d/action.yaml index 7d56825ea1..e957ac90bc 100644 --- a/.github/actions/setup-k3d/action.yaml +++ b/.github/actions/setup-k3d/action.yaml @@ -14,7 +14,7 @@ # limitations under the License. # name: "Setup k3d environment" -description: "A action to set up k3d (k3s in Docker)" +description: "An action to set up k3d (k3s in Docker)" inputs: version: description: "k3d version" @@ -67,12 +67,21 @@ runs: echo "tag=${K3S_VERSION}" >> $GITHUB_OUTPUT env: K3S_VERSION: ${{ inputs.k3s_version }} - - name: Install k3d + - name: Check if k3d is installed + id: check_k3d shell: bash run: | - curl -s ${REPO_URL} | ${{ steps.k3d_version.outputs.tag }} bash - env: - REPO_URL: "https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh" + if command -v k3d &> /dev/null; then + echo "k3d_installed=true" >> $GITHUB_OUTPUT + echo "installed_version=$(k3d version --short | sed 's/^v//')" >> $GITHUB_OUTPUT + else + echo "k3d_installed=false" >> $GITHUB_OUTPUT + fi + - name: Install k3d (if not installed or version mismatch) + if: steps.check_k3d.outputs.k3d_installed == 'false' || steps.check_k3d.outputs.installed_version != steps.k3d_version.outputs.tag + shell: bash + run: | + make k3d/install - name: Check k3d version shell: bash run: | diff --git a/.github/actions/setup-yq/action.yaml b/.github/actions/setup-yq/action.yaml index f2e9b0c8b3..7a85ad1eb6 100644 --- a/.github/actions/setup-yq/action.yaml +++ b/.github/actions/setup-yq/action.yaml @@ -14,7 +14,7 @@ # limitations under the License. # name: "Setup yq environment" -description: "A action to set up yq" +description: "An action to set up yq" inputs: yq_version: description: "The yq version to use. The default version is `versions/YQ_VERSION`" diff --git a/.github/actions/wait-for-docker-image/action.yaml b/.github/actions/wait-for-docker-image/action.yaml index 546a46d805..ebf2cc67d9 100644 --- a/.github/actions/wait-for-docker-image/action.yaml +++ b/.github/actions/wait-for-docker-image/action.yaml @@ -14,7 +14,7 @@ # limitations under the License. # name: "Wait for Docker Images" -description: "A action to wait for Docker images to be published" +description: "An action to wait for Docker images to be published" inputs: images: description: "image names" diff --git a/.github/workflows/build-binaries.yaml b/.github/workflows/build-binaries.yaml index f87e9151fb..ba7ec41881 100644 --- a/.github/workflows/build-binaries.yaml +++ b/.github/workflows/build-binaries.yaml @@ -38,7 +38,6 @@ jobs: - name: Set Git config run: | git config --global --add safe.directory ${GITHUB_WORKSPACE} - - uses: ./.github/actions/setup-go - name: Build and zip run: | make binary/build/zip diff --git a/.github/workflows/chatops.yaml b/.github/workflows/chatops.yaml index 7f4f2e2055..a813873897 100644 --- a/.github/workflows/chatops.yaml +++ b/.github/workflows/chatops.yaml @@ -24,9 +24,11 @@ jobs: - uses: actions/checkout@v4 - uses: ./.github/actions/dump-context label: + if: github.event.comment.user.login != 'vdaas-ci' name: Add labels runs-on: ubuntu-latest - if: github.event.comment.user.login != 'vdaas-ci' + container: + image: ghcr.io/vdaas/vald/vald-ci-container:nightly steps: - name: Check PR Comments id: check_comments_label @@ -35,8 +37,6 @@ jobs: TRIGGER_PHRASE: "/label" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: ./.github/actions/setup-yq - if: steps.check_comments_label.outputs.BOOL_TRIGGERED == 'true' - name: Check permissions if: steps.check_comments_label.outputs.BOOL_TRIGGERED == 'true' id: check_permissions @@ -74,9 +74,11 @@ jobs: USERNAME: ${{ steps.check_comments_label.outputs.COMMENTER_USERNAME }} TRAILING_LINE: ${{ steps.check_comments_label.outputs.TRAILING_LINE }} rebase: + if: github.event.comment.user.login != 'vdaas-ci' name: Rebase runs-on: ubuntu-latest - if: github.event.comment.user.login != 'vdaas-ci' + container: + image: ghcr.io/vdaas/vald/vald-ci-container:nightly steps: - name: Check PR Comments id: check_comments_rebase @@ -85,8 +87,6 @@ jobs: TRIGGER_PHRASE: "/rebase" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: ./.github/actions/setup-yq - if: steps.check_comments_rebase.outputs.BOOL_TRIGGERED == 'true' - name: Check permissions if: steps.check_comments_rebase.outputs.BOOL_TRIGGERED == 'true' id: check_permissions @@ -149,11 +149,13 @@ jobs: GITHUB_TOKEN: ${{ secrets.DISPATCH_TOKEN }} API_URL: ${{ github.event.issue.comments_url }} gentest: + if: github.event.comment.user.login != 'vdaas-ci' name: Add tests needs: - rebase runs-on: ubuntu-latest - if: github.event.comment.user.login != 'vdaas-ci' + container: + image: ghcr.io/vdaas/vald/vald-ci-container:nightly steps: - name: check PR Comments id: check_comments_gen_test @@ -162,8 +164,6 @@ jobs: TRIGGER_PHRASE: "/gen-test" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: ./.github/actions/setup-yq - if: steps.check_comments_gen_test.outputs.BOOL_TRIGGERED == 'true' - name: check permissions if: steps.check_comments_gen_test.outputs.BOOL_TRIGGERED == 'true' id: check_permissions @@ -212,8 +212,6 @@ jobs: gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} git_user_signingkey: true git_commit_gpgsign: true - - uses: ./.github/actions/setup-go - if: steps.check_comments_gen_test.outputs.BOOL_TRIGGERED == 'true' && steps.check_permissions.outputs.EXECUTABLE == 'true' - name: Generate tests and push id: gen_test if: steps.check_comments_gen_test.outputs.BOOL_TRIGGERED == 'true' && steps.check_permissions.outputs.EXECUTABLE == 'true' @@ -263,12 +261,14 @@ jobs: GITHUB_TOKEN: ${{ secrets.DISPATCH_TOKEN }} API_URL: ${{ github.event.issue.comments_url }} format: + if: github.event.comment.user.login != 'vdaas-ci' name: Add license and run golines + gofumpt + goimports needs: - rebase - gentest runs-on: ubuntu-latest - if: github.event.comment.user.login != 'vdaas-ci' + container: + image: ghcr.io/vdaas/vald/vald-ci-container:nightly steps: - name: check PR Comments id: check_comments_format @@ -277,8 +277,6 @@ jobs: TRIGGER_PHRASE: "/format" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: ./.github/actions/setup-yq - if: steps.check_comments_format.outputs.BOOL_TRIGGERED == 'true' - name: check permissions if: steps.check_comments_format.outputs.BOOL_TRIGGERED == 'true' id: check_permissions @@ -327,8 +325,6 @@ jobs: gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} git_user_signingkey: true git_commit_gpgsign: true - - uses: ./.github/actions/setup-go - if: steps.check_comments_format.outputs.BOOL_TRIGGERED == 'true' && steps.check_permissions.outputs.EXECUTABLE == 'true' - name: update and push id: format_push if: steps.check_comments_format.outputs.BOOL_TRIGGERED == 'true' && steps.check_permissions.outputs.EXECUTABLE == 'true' @@ -397,12 +393,14 @@ jobs: GITHUB_TOKEN: ${{ secrets.DISPATCH_TOKEN }} API_URL: ${{ github.event.issue.comments_url }} approve: + if: github.event.comment.user.login != 'vdaas-ci' name: Approve needs: - rebase - format runs-on: ubuntu-latest - if: github.event.comment.user.login != 'vdaas-ci' + container: + image: ghcr.io/vdaas/vald/vald-ci-container:nightly steps: - name: check PR Comments id: check_comments_approve @@ -411,8 +409,6 @@ jobs: TRIGGER_PHRASE: "/approve" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: ./.github/actions/setup-yq - if: steps.check_comments_approve.outputs.BOOL_TRIGGERED == 'true' - name: check permissions if: steps.check_comments_approve.outputs.BOOL_TRIGGERED == 'true' id: check_permissions diff --git a/.github/workflows/e2e-code-bench-agent.yaml b/.github/workflows/e2e-code-bench-agent.yaml index a1cdad029d..82ad5a1eb3 100644 --- a/.github/workflows/e2e-code-bench-agent.yaml +++ b/.github/workflows/e2e-code-bench-agent.yaml @@ -64,7 +64,6 @@ jobs: - name: Set Git config run: | git config --global --add safe.directory ${GITHUB_WORKSPACE} - - uses: ./.github/actions/setup-go - name: Run grpc-sequential run: | make hack/benchmark/assets/dataset/${{ env.DATASET }} @@ -92,7 +91,6 @@ jobs: - name: Set Git config run: | git config --global --add safe.directory ${GITHUB_WORKSPACE} - - uses: ./.github/actions/setup-go - name: Run grpc-stream run: | make hack/benchmark/assets/dataset/${{ env.DATASET }} diff --git a/.github/workflows/format.yaml b/.github/workflows/format.yaml index 846b523b42..beb4fe9ce2 100644 --- a/.github/workflows/format.yaml +++ b/.github/workflows/format.yaml @@ -54,8 +54,6 @@ jobs: git checkout main git checkout -b ${BRANCH_NAME} echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_OUTPUT - - name: Setup Go environment - uses: ./.github/actions/setup-go - name: Run formatter and license.go run: | make format @@ -99,8 +97,6 @@ jobs: - name: Set Git config run: | git config --global --add safe.directory ${GITHUB_WORKSPACE} - - name: Setup Go environment - uses: ./.github/actions/setup-go - name: Run `make format` and `make deps/install` run: | make deps/install diff --git a/.github/workflows/helm-lint.yaml b/.github/workflows/helm-lint.yaml index 2d82d6c653..46dc59a213 100644 --- a/.github/workflows/helm-lint.yaml +++ b/.github/workflows/helm-lint.yaml @@ -38,8 +38,6 @@ jobs: - name: set git config run: | git config --global --add safe.directory ${GITHUB_WORKSPACE} - - uses: ./.github/actions/setup-go - - uses: ./.github/actions/setup-helm - name: Generate schema for charts/vald run: | make helm/schema/vald @@ -58,8 +56,6 @@ jobs: - name: set git config run: | git config --global --add safe.directory ${GITHUB_WORKSPACE} - - uses: ./.github/actions/setup-go - - uses: ./.github/actions/setup-helm - name: Generate schema for charts/vald-helm-operator run: | make helm/schema/vald-helm-operator @@ -79,9 +75,6 @@ jobs: - name: set git config run: | git config --global --add safe.directory ${GITHUB_WORKSPACE} - - uses: ./.github/actions/setup-yq - - uses: ./.github/actions/setup-go - - uses: ./.github/actions/setup-helm - uses: ./.github/actions/setup-k3d with: options: "--api-port host.docker.internal:6443 --kubeconfig-update-default --kubeconfig-switch-context" diff --git a/.github/workflows/helm.yaml b/.github/workflows/helm.yaml index 970fb2a209..48b75fc1f8 100644 --- a/.github/workflows/helm.yaml +++ b/.github/workflows/helm.yaml @@ -49,8 +49,6 @@ jobs: gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} git_user_signingkey: true git_commit_gpgsign: true - - name: Setup Helm environment - uses: ./.github/actions/setup-helm - name: Packaging run: | make helm/package/vald diff --git a/Makefile.d/helm.mk b/Makefile.d/helm.mk index 74dd358fc8..92d6a23770 100644 --- a/Makefile.d/helm.mk +++ b/Makefile.d/helm.mk @@ -156,17 +156,6 @@ $(ROOTDIR)/charts/vald-benchmark-operator/values.schema.json: \ $(ROOTDIR)/charts/vald-benchmark-operator/values.yaml $(call gen-vald-helm-schema,vald-benchmark-operator/values) -.PHONY: yq/install -## install yq -yq/install: $(BINDIR)/yq - -$(BINDIR)/yq: - mkdir -p $(BINDIR) - $(eval DARCH := $(subst aarch64,arm64,$(ARCH))) - cd $(TEMP_DIR) \ - && curl -fsSL https://github.com/mikefarah/yq/releases/download/$(YQ_VERSION)/yq_$(OS)_$(subst x86_64,amd64,$(shell echo $(DARCH) | tr '[:upper:]' '[:lower:]')) -o $(BINDIR)/yq \ - && chmod a+x $(BINDIR)/yq - .PHONY: helm/schema/crd/all helm/schema/crd/all: \ helm/schema/crd/vald \ diff --git a/Makefile.d/tools.mk b/Makefile.d/tools.mk index e18836ccc5..0c7e7d98c3 100644 --- a/Makefile.d/tools.mk +++ b/Makefile.d/tools.mk @@ -118,7 +118,6 @@ $(NPM_GLOBAL_PREFIX)/bin/cspell: cspell link add @cspell/dict-rust cspell link add @cspell/dict-shell - .PHONY: buf/install buf/install: $(BINDIR)/buf @@ -261,3 +260,15 @@ $(LIB_PATH)/libhdf5.a: $(LIB_PATH) \ && make install \ && cd $(ROOTDIR) \ && rm -rf $(TEMP_DIR)/hdf5.tar.gz $(TEMP_DIR)/hdf5 + +.PHONY: yq/install +## install yq +yq/install: $(BINDIR)/yq + +$(BINDIR)/yq: + mkdir -p $(BINDIR) + $(eval DARCH := $(subst aarch64,arm64,$(ARCH))) + cd $(TEMP_DIR) \ + && curl -fsSL https://github.com/mikefarah/yq/releases/download/$(YQ_VERSION)/yq_$(OS)_$(subst x86_64,amd64,$(shell echo $(DARCH) | tr '[:upper:]' '[:lower:]')) -o $(BINDIR)/yq \ + && chmod a+x $(BINDIR)/yq +