-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: david_smith <david_smith@sweetwater.com>
- Loading branch information
1 parent
f21b7be
commit 2caf321
Showing
4 changed files
with
31 additions
and
16 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
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,21 +1,18 @@ | ||
# run-tests.sh | ||
#!/bin/bash | ||
set -e | ||
|
||
php_versions=("php83" "php82" "php81") | ||
|
||
for version in "${php_versions[@]}"; do | ||
if [ -f composer.lock ]; then | ||
echo "removing composer.lock" | ||
rm composer.lock | ||
fi | ||
vendor_dir="./vendor-${version}" | ||
|
||
docker compose run --rm "$version"composer composer install | ||
if [ ! -d "$vendor_dir" ] || [ -z "$(ls -A "$vendor_dir")" ]; then | ||
echo "Dependencies not found or vendor directory is empty for $version. Installing dependencies..." | ||
docker compose run --rm "${version}composer" composer install --no-cache | ||
fi | ||
|
||
echo "Running tests on $version..." | ||
if ! docker compose run --rm "$version" vendor/bin/phpunit; then | ||
echo "Tests failed on $version." | ||
exit 1 | ||
fi | ||
done | ||
|
||
echo "All tests passed!" | ||
done |