-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
08bda3d
commit ab83bb7
Showing
8 changed files
with
141 additions
and
25 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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Cairo Zero (Fustat) tests | ||
|
||
on: | ||
push: | ||
merge_group: | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python 3.10.14 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.10.14 | ||
- name: Install dependencies | ||
run: | | ||
python -m venv venv | ||
source venv/bin/activate | ||
echo 'export PYTHONPATH="$PWD:$PYTHONPATH"' >> venv/bin/activate | ||
pip install cairo-lang==0.13.2a0 | ||
- name: Install GNU Parallel | ||
run: sudo apt-get update && sudo apt-get install -y parallel | ||
- name: Check cairo Formatting | ||
run: | | ||
source venv/bin/activate && ./tools/make/fustat_format_check.sh | ||
- name: Compile cairo files | ||
run: | | ||
source venv/bin/activate && make build |
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,27 @@ | ||
#!/bin/bash | ||
|
||
# Function to check a file formatting and print a message based on the outcome | ||
format_file() { | ||
cairo-format -c "$1" | ||
local status=$? | ||
if [ $status -eq 0 ]; then | ||
echo "$(date '+%Y-%m-%d %H:%M:%S') - File $1 is formatted correctly" | ||
else | ||
echo "$(date '+%Y-%m-%d %H:%M:%S') - File $1 is not formatted correctly" | ||
return $status | ||
fi | ||
} | ||
|
||
# Export the function so it's available in subshells | ||
export -f format_file | ||
|
||
# Find all .cairo files under src/ and tests/ directories and format them in parallel | ||
# Using --halt soon,fail=1 to stop at the first failure | ||
find ./src/fustat ./tests/fustat_programs -name '*.cairo' | parallel --halt soon,fail=1 format_file | ||
|
||
# Capture the exit status of parallel | ||
exit_status=$? | ||
|
||
# Exit with the captured status | ||
echo "Parallel execution exited with status: $exit_status" | ||
exit $exit_status |
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