diff options
| author | Zhineng Li <[email protected]> | 2026-01-21 10:49:17 +0800 |
|---|---|---|
| committer | Zhineng Li <[email protected]> | 2026-01-21 10:49:17 +0800 |
| commit | 4aad07d551b920a61596cf27c9357f92c6516717 (patch) | |
| tree | 9c9475e9c021ff393966cfd99edc3b0afa9414a0 /scripts | |
| parent | e9c4a26494516f8c71fa1cbbc741ccf2212ceb76 (diff) | |
| download | vehicle-license-china-4aad07d551b920a61596cf27c9357f92c6516717.tar.gz vehicle-license-china-4aad07d551b920a61596cf27c9357f92c6516717.zip | |
matrix test
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/test.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/scripts/test.sh b/scripts/test.sh new file mode 100755 index 0000000..70554be --- /dev/null +++ b/scripts/test.sh @@ -0,0 +1,28 @@ +#!/bin/sh +set -e + +COMPOSER_PHAR="/root/.composer/composer.phar" +WORKDIR="/tmp/app" + +# Copy project to isolated working directory +rm -rf "$WORKDIR" +cp -r /app "$WORKDIR" +cd "$WORKDIR" + +# Remove lock file and vendor for fresh install +rm -f composer.lock +rm -rf vendor/ + +# Download Composer if not cached +if [ ! -f "$COMPOSER_PHAR" ]; then + echo "Downloading Composer..." + mkdir -p /root/.composer + curl -sS https://getcomposer.org/installer | php -- --install-dir=/root/.composer --filename=composer.phar +fi + +# Install dependencies +echo "COMPOSER_FLAGS: ${COMPOSER_FLAGS:-<empty>}" +php "$COMPOSER_PHAR" update --no-interaction ${COMPOSER_FLAGS:-} + +# Run tests +php "$COMPOSER_PHAR" test |
