-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 539d66bbbeb39489f22b4539d571fb30f2286d12 Introduce validation GitHub action by Config Connector Team <no-reply@google.com> - 51c8cae5973b77171e6c84206c188d10d11e8693 Remove external folder by Config Connector Team <no-reply@google.com> GitOrigin-RevId: 539d66bbbeb39489f22b4539d571fb30f2286d12
- Loading branch information
1 parent
2299b53
commit 27c79cc
Showing
6 changed files
with
128 additions
and
4 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
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,26 @@ | ||
#!/bin/bash | ||
# Copyright 2023 Google LLC | ||
# | ||
# 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. | ||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
REPO_ROOT="$(git rev-parse --show-toplevel)" | ||
source ${REPO_ROOT}/scripts/shared-vars-public.sh | ||
cd ${REPO_ROOT} | ||
source ${SCRIPT_DIR}/fetch_ext_bins.sh && \ | ||
fetch_tools && \ | ||
setup_envs | ||
|
||
echo "Running validations..." | ||
${SCRIPT_DIR}/validate-prereqs.sh |
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,73 @@ | ||
#!/bin/bash | ||
# Copyright 2022 Google LLC | ||
# | ||
# 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. | ||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
REPO_ROOT="$(git rev-parse --show-toplevel)" | ||
cd "${REPO_ROOT}" | ||
|
||
make fmt | ||
changed_file_count=$(git diff --name-only | wc -l) | ||
if [[ "${changed_file_count}" != "0" ]]; then | ||
echo "Full diff:" | ||
git diff | ||
echo "ERROR: Files not formatted correctly. Please run 'make fmt' and patch your CL." | ||
echo "Affected files:" | ||
git diff --name-only | ||
exit 1 | ||
fi | ||
make generate | ||
changed_file_count=$(git diff --name-only | wc -l) | ||
if [[ "${changed_file_count}" != "0" ]]; then | ||
echo "ERROR: Generated code out-of-date. Please run 'make generate' and patch your CL." | ||
echo "Affected files:" | ||
git diff --name-only | ||
exit 1 | ||
fi | ||
make manifests | ||
changed_file_count=$(git diff --name-only | wc -l) | ||
if [[ "${changed_file_count}" != "0" ]]; then | ||
echo "ERROR: Manifests must be regenerated. Please run 'make manifests' and patch your CL." | ||
echo "Affected files:" | ||
git diff --name-only | ||
exit 1 | ||
fi | ||
make generate-go-client | ||
changed_file_count=$(git diff --name-only | wc -l) | ||
if [[ "${changed_file_count}" != "0" ]]; then | ||
echo "ERROR: Resource Go Clients must be regenerated. Please run 'make generate-go-client' and patch your CL." | ||
echo "Affected files:" | ||
git diff --name-only | ||
exit 1 | ||
fi | ||
make ensure | ||
if [[ $? -ne 0 ]]; then | ||
echo "'make ensure' failed. Please validate the override patch files." | ||
fi | ||
changed_file_count=$(git diff --name-only | wc -l) | ||
if [[ "${changed_file_count}" != "0" ]]; then | ||
echo "ERROR: Vendored code does not match go.mod (+ override patches). Please run 'make ensure' and patch your CL." | ||
echo "Affected files:" | ||
git diff --name-only | ||
exit 1 | ||
fi | ||
make resource-docs | ||
changed_file_count=$(git diff --name-only | wc -l) | ||
if [[ "${changed_file_count}" != "0" ]]; then | ||
echo "ERROR: Resource docs must be regenerated. Please run 'make resource-docs' and patch your CL." | ||
echo "Affected files:" | ||
git diff --name-only | ||
exit 1 | ||
fi |