Consolidate continuous integration scripts

Merge before_script.sh into script.sh
This commit is contained in:
Zach Borboa
2021-03-29 00:14:52 -04:00
parent 64df98c50f
commit a315b541be
3 changed files with 23 additions and 27 deletions
+1 -3
View File
@@ -27,8 +27,6 @@ jobs:
uses: actions/checkout@v2
- name: Test
run: |
bash tests/before_script.sh
bash tests/script.sh
run: bash tests/script.sh
env:
CI_PHP_VERSION: ${{ matrix.php }}
-21
View File
@@ -1,21 +0,0 @@
set -x
echo "CI_PHP_VERSION: ${CI_PHP_VERSION}"
php -r "var_dump(phpversion());"
php -r "var_dump(curl_version());"
composer self-update
composer install --prefer-source --no-interaction
# Let test server know we should allow testing.
export PHP_CURL_CLASS_TEST_MODE_ENABLED="yes"
# Start test servers. Run servers on different ports to allow simultaneous
# requests without blocking.
server_count=7
for i in $(seq 0 $(("${server_count}" - 1))); do
port=8000
(( port += $i ))
php -S "127.0.0.1:${port}" -t tests/PHPCurlClass/ &
done
+22 -3
View File
@@ -1,3 +1,25 @@
set -x
echo "CI_PHP_VERSION: ${CI_PHP_VERSION}"
php -r "var_dump(phpversion());"
php -r "var_dump(curl_version());"
composer self-update
composer install --prefer-source --no-interaction
# Let test server know we should allow testing.
export PHP_CURL_CLASS_TEST_MODE_ENABLED="yes"
# Start test servers. Run servers on different ports to allow simultaneous
# requests without blocking.
server_count=7
for i in $(seq 0 $(("${server_count}" - 1))); do
port=8000
(( port += $i ))
php -S "127.0.0.1:${port}" -t tests/PHPCurlClass/ &
done
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "${SCRIPT_DIR}"
@@ -34,9 +56,6 @@ errors=()
source "check_syntax.sh"
# Let test server know we should allow testing.
export PHP_CURL_CLASS_TEST_MODE_ENABLED="yes"
# Determine which phpunit to use.
if [[ -f "../vendor/bin/phpunit" ]]; then
phpunit_to_use="../vendor/bin/phpunit"