-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: trying to remove the scripts from git diff
Signed-off-by: Abinand P <[email protected]>
- Loading branch information
1 parent
8c4eb1e
commit e005869
Showing
2 changed files
with
111 additions
and
127 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 |
---|---|---|
@@ -1,63 +1,63 @@ | ||
#!/bin/bash | ||
|
||
# Exit immediately if a command exits with a non-zero status | ||
set -e | ||
|
||
# Display a help text | ||
[ "$1" = "-h" -o "$1" = "--help" ] && echo "Runs all CI checks (excluding tests and udeps)." && exit | ||
|
||
# The path to the YAML file that defines the CI workflows | ||
YAML_FILE=".github/workflows/lint-and-test.yml" | ||
|
||
# Initialize the directory we're searching from (current directory) | ||
current_dir=$(pwd) | ||
|
||
# Traverse upwards to find the root directory, assuming it exists somewhere above | ||
while [[ ! -f "$current_dir/sxt-proof-of-sql/.github/workflows/lint-and-test.yml" ]]; do | ||
# Move up one directory | ||
current_dir=$(dirname "$current_dir") | ||
|
||
# If we reach the root directory (i.e., /), stop to prevent an infinite loop | ||
if [[ "$current_dir" == "/" ]]; then | ||
echo "Could not find file." | ||
exit 1 | ||
fi | ||
done | ||
|
||
# Check if the YAML file exists | ||
if [ ! -f "$YAML_FILE" ]; then | ||
echo "YAML file $YAML_FILE does not exist." | ||
exit 1 | ||
fi | ||
|
||
# Extract all lines that contain 'cargo' commands from the YAML file, | ||
# excluding ones with '--ignored', 'test', 'rustup', or 'udeps' | ||
cargo_commands=$(grep -E '^\s*run:.*cargo' "$YAML_FILE" | grep -v -- '--ignored' | grep -v 'test' | grep -v 'rustup' | grep -v 'udeps' | sed -E 's/^\s*run:\s*//') | ||
|
||
if [ -z "$cargo_commands" ]; then | ||
echo "No cargo commands (other than tests) found in the YAML file." | ||
exit 1 | ||
fi | ||
|
||
# Run each cargo command, ignoring tests which should be handled separately | ||
echo "Extracted cargo commands (excluding test commands, --ignored tests, and udeps):" | ||
echo "$cargo_commands" | ||
echo "=========================" | ||
|
||
# Execute the commands | ||
failed_tests=0 | ||
while IFS= read -r cmd; do | ||
echo "Running command: $cmd" | ||
if ! eval "$cmd"; then | ||
echo "Error: Command failed - $cmd" | ||
echo "Stopping execution." | ||
failed_tests=$((failed_tests + 1)) | ||
fi | ||
done <<< "$cargo_commands" | ||
|
||
# Print the results | ||
if [ "$failed_tests" -gt 0 ]; then | ||
echo "Error: $failed_tests CI checks (excluding tests and udeps) have FAILED." | ||
else | ||
echo "All CI checks (excluding tests and udeps) have completed successfully." | ||
fi | ||
#!/bin/bash | ||
|
||
# Exit immediately if a command exits with a non-zero status | ||
set -e | ||
|
||
# Display a help text | ||
[ "$1" = "-h" -o "$1" = "--help" ] && echo "Runs all CI checks (excluding tests and udeps)." && exit | ||
|
||
# The path to the YAML file that defines the CI workflows | ||
YAML_FILE=".github/workflows/lint-and-test.yml" | ||
|
||
# Initialize the directory we're searching from (current directory) | ||
current_dir=$(pwd) | ||
|
||
# Traverse upwards to find the root directory, assuming it exists somewhere above | ||
while [[ ! -f "$current_dir/sxt-proof-of-sql/.github/workflows/lint-and-test.yml" ]]; do | ||
# Move up one directory | ||
current_dir=$(dirname "$current_dir") | ||
|
||
# If we reach the root directory (i.e., /), stop to prevent an infinite loop | ||
if [[ "$current_dir" == "/" ]]; then | ||
echo "Could not find file." | ||
exit 1 | ||
fi | ||
done | ||
|
||
# Check if the YAML file exists | ||
if [ ! -f "$YAML_FILE" ]; then | ||
echo "YAML file $YAML_FILE does not exist." | ||
exit 1 | ||
fi | ||
|
||
# Extract all lines that contain 'cargo' commands from the YAML file, | ||
# excluding ones with '--ignored', 'test', 'rustup', or 'udeps' | ||
cargo_commands=$(grep -E '^\s*run:.*cargo' "$YAML_FILE" | grep -v -- '--ignored' | grep -v 'test' | grep -v 'rustup' | grep -v 'udeps' | sed -E 's/^\s*run:\s*//') | ||
|
||
if [ -z "$cargo_commands" ]; then | ||
echo "No cargo commands (other than tests) found in the YAML file." | ||
exit 1 | ||
fi | ||
|
||
# Run each cargo command, ignoring tests which should be handled separately | ||
echo "Extracted cargo commands (excluding test commands, --ignored tests, and udeps):" | ||
echo "$cargo_commands" | ||
echo "=========================" | ||
|
||
# Execute the commands | ||
failed_tests=0 | ||
while IFS= read -r cmd; do | ||
echo "Running command: $cmd" | ||
if ! eval "$cmd"; then | ||
echo "Error: Command failed - $cmd" | ||
echo "Stopping execution." | ||
failed_tests=$((failed_tests + 1)) | ||
fi | ||
done <<< "$cargo_commands" | ||
|
||
# Print the results | ||
if [ "$failed_tests" -gt 0 ]; then | ||
echo "Error: $failed_tests CI checks (excluding tests and udeps) have FAILED." | ||
else | ||
echo "All CI checks (excluding tests and udeps) have completed successfully." | ||
fi |