Skip to content

Commit

Permalink
update flake
Browse files Browse the repository at this point in the history
  • Loading branch information
Siddharth2207 committed Sep 5, 2024
1 parent 9d7ab54 commit 46bd373
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
echo "MANIFEST_PATH=./lib/h20.test-std/lib/rain.orderbook/Cargo.toml" >> $GITHUB_ENV
echo "SETTINGS_PATH=src/settings.yml" >> $GITHUB_ENV
echo "DOTRAIN_FOLDER_PATH=./src/tranche" >> $GITHUB_ENV
echo "DOTRAIN_EXCLUDE_PATHS='src/learning/ethcc/* src/wip/*'" >> $GITHUB_ENV
echo "COMMIT_SHA=$(cd ./lib/h20.test-std/lib/rain.orderbook && git rev-parse HEAD)" >> $GITHUB_ENV
- uses: actions/checkout@v4
Expand Down
22 changes: 20 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@
body = ''
set -euxo pipefail
# The path to the rain files.
dotrain_folder_path=''${DOTRAIN_FOLDER_PATH:-.}
# Get all the rain files in the sub folders.
dotrain_paths=""
for folder in "$dotrain_folder_path"/*; do
if [ -d "$folder" ]; then
Expand All @@ -30,20 +32,36 @@
fi
done
# Get all the rain files in the current folder.
for dotrain in "$dotrain_folder_path"/*.rain ; do
dotrain_paths+=" $dotrain"
done
# Remove leading and trailing whitespace.
dotrain_paths=$(echo "$dotrain_paths" | tr -s ' ' | sed 's/^ //;s/ $//')
# Exclude paths.
exclude_paths=''${DOTRAIN_EXCLUDE_PATHS:-}
# Remove the excluded paths.
for exclude_path in $exclude_paths; do
dotrain_paths=$(echo "$dotrain_paths" | tr ' ' '\n' | grep -v "$exclude_path" | tr '\n' ' ')
done
for dotrain in $dotrain_paths
do
echo "Checking deployments within $dotrain"
deployment_keys=$(cargo run --manifest-path ''${MANIFEST_PATH} --package rain_orderbook_cli order keys -f $dotrain ''${SETTINGS_PATH:+-c "''${SETTINGS_PATH}"})
deployment_keys=$( \
cargo run --manifest-path ''${MANIFEST_PATH} --package rain_orderbook_cli \
order keys \
-f $dotrain ''${SETTINGS_PATH:+-c "''${SETTINGS_PATH}"} \
)
for key in $deployment_keys
do
echo "key: $key"
cargo run --manifest-path ''${MANIFEST_PATH} --package rain_orderbook_cli words -f $dotrain ''${SETTINGS_PATH:+-c "''${SETTINGS_PATH}"} --deployment "$key" --stdout
cargo run --manifest-path ''${MANIFEST_PATH} \
--package rain_orderbook_cli \
words -f $dotrain ''${SETTINGS_PATH:+-c "''${SETTINGS_PATH}"} --deployment "$key" --stdout
done
done
Expand Down

0 comments on commit 46bd373

Please sign in to comment.