-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci tests #5
Merged
Merged
ci tests #5
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,25 @@ | ||
#!/bin/bash | ||
|
||
cd ../ | ||
|
||
run_build() { | ||
build_type=$1 | ||
build_dir=$2 | ||
|
||
echo "Building with BUILD_TYPE=$build_type..." | ||
|
||
make -B build BUILD_TYPE="$build_type" BUILD_DIR="$build_dir" | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "Error: Build failed for BUILD_TYPE=$build_type." | ||
exit 1 | ||
else | ||
echo "Success: Build completed successfully for BUILD_TYPE=$build_type." | ||
fi | ||
} | ||
|
||
run_build Debug build-debug | ||
run_build Release build | ||
|
||
echo "All build tests completed successfully." | ||
exit 0 |
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,24 @@ | ||
#!/bin/bash | ||
|
||
export HEADER_FILE="/dev/null" | ||
export CBINDGEN_CONFIG="../../cbindgen.toml" | ||
|
||
CRATES_DIR="../crates" | ||
|
||
for dir in "$CRATES_DIR"/*; do | ||
if [ -d "$dir" ]; then | ||
echo "Entering directory: $dir" | ||
cd "$dir" || exit | ||
|
||
cargo test | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "Error: cargo test failed in $dir" | ||
exit 1 | ||
fi | ||
|
||
cd - || exit | ||
fi | ||
done | ||
|
||
echo "All tests completed successfully." |
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,38 @@ | ||
import os | ||
|
||
required_structure = { | ||
'install': { | ||
'include': { | ||
'arkworks': ['arkworks.h'], | ||
'bandersnatch_vrfs': ['bandersnatch_vrfs.h'], | ||
'schnorrkel': ['schnorrkel.h'] | ||
}, | ||
'lib': { | ||
'cmake': { | ||
'arkworks': ['arkworksConfig.cmake'], | ||
'bandersnatch_vrfs': ['bandersnatch_vrfsConfig.cmake'], | ||
'schnorrkel': ['schnorrkelConfig.cmake'] | ||
}, | ||
'': ['libarkworks_crust.a', 'libbandersnatch_vrfs_crust.a', 'libschnorrkel_crust.a'] | ||
} | ||
} | ||
} | ||
|
||
def check_structure(base_path, structure): | ||
for folder, contents in structure.items(): | ||
current_path = os.path.join(base_path, folder) | ||
|
||
if isinstance(contents, dict): | ||
if not os.path.isdir(current_path): | ||
print(f"Missing directory: {current_path}") | ||
else: | ||
check_structure(current_path, contents) | ||
else: | ||
for file in contents: | ||
file_path = os.path.join(base_path, folder, file) | ||
if not os.path.isfile(file_path): | ||
print(f"Missing file: {file_path}") | ||
|
||
base_path = '../' | ||
|
||
check_structure(base_path, required_structure) |
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,34 @@ | ||
#!/bin/bash | ||
|
||
scripts=("build_test.sh" "check_files.py" "cargo_tests.sh") | ||
|
||
error_found=0 | ||
|
||
for script in "${scripts[@]}"; do | ||
echo "Running $script..." | ||
|
||
if [[ "$script" == *.py ]]; then | ||
python3 "$script" | ||
elif [[ "$script" == *.sh ]]; then | ||
bash "$script" | ||
else | ||
echo "Unknown file type for script: $script" | ||
error_found=1 | ||
continue | ||
fi | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "Error: $script failed." | ||
error_found=1 | ||
else | ||
echo "Success: $script completed successfully." | ||
fi | ||
done | ||
|
||
if [ $error_found -ne 0 ]; then | ||
echo "One or more scripts failed." | ||
exit 1 | ||
else | ||
echo "All scripts ran successfully." | ||
exit 0 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
target | ||
/build | ||
/generated | ||
/install | ||
/.idea | ||
/build-* | ||
|
||
**/Cargo.lock | ||
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,16 @@ | ||
BUILD_DIR ?= build | ||
BUILD_TYPE ?= Release | ||
|
||
BUILD_THREADS := $$(nproc 2>/dev/null || sysctl -n hw.ncpu) | ||
|
||
|
||
build: | ||
if [ "$$(uname)" = "Darwin" ]; then \ | ||
export SDKROOT=$$(xcrun --sdk macosx --show-sdk-path) ; \ | ||
fi ; \ | ||
cmake . -B"$(BUILD_DIR)" -DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) ; \ | ||
cmake --build "$(BUILD_DIR)" -- -j$(BUILD_THREADS) ; \ | ||
cmake --install "$(BUILD_DIR)" | ||
|
||
run_tests: | ||
cd .ci && ./run_all_tests.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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should generally be present in the repository, what's the reason to exclude it here?