Skip to content

Commit

Permalink
Merge pull request #3 from neonlabsorg/NDEV-2655
Browse files Browse the repository at this point in the history
Run projects tests directly via runner script
  • Loading branch information
lyubenkov authored Apr 8, 2024
2 parents 2603b82 + 77bc2de commit 308a535
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dockerize.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
if [[ "${{ github.ref_name }}" == 'master' ]]; then
tag='latest'
else
tag='${{ github.sha }}'
tag='${{ github.head_ref || github.ref_name }}'
fi
echo "tag=${tag}"
echo "tag=${tag}" >> $GITHUB_OUTPUT
Expand Down
30 changes: 24 additions & 6 deletions docker/run.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
#!/bin/bash

# Run tests for each package with a pause
for PACKAGE in $(lerna la -p --json | jq -r '.[].name'); do
echo "Running command for $PACKAGE"
lerna run test --scope="$PACKAGE" --stream
subprojects=($(lerna la -p --json | jq -r '.[].name'))
error_occurred=0

sleep 1
done
for subproject in "${subprojects[@]}"
do
project_dir="projects/$subproject"
if test -f "$project_dir/hardhat.config.ts"; then
echo "Running subproject: $subproject"
npx hardhat test --config "$project_dir/hardhat.config.ts"
fi

exit_code=$?
if [ $exit_code -ne 0 ]; then
echo "Subproject $subproject failed with exit code $exit_code"
error_occurred=1
fi
done

if [ $error_occurred -ne 0 ]; then
echo "One or more subprojects failed."
exit 1
fi

echo "All subprojects completed successfully."
exit 0

0 comments on commit 308a535

Please sign in to comment.