Updated workflow (experimental)
Some checks are pending
CI / release (push) Waiting to run
CI / debug (push) Waiting to run
CI / release_executable (push) Waiting to run
CI / debug_executable (push) Waiting to run
CI / check-phpunit (push) Waiting to run
CI / check-phpdoc (push) Waiting to run
CI / generate-phpdoc (push) Blocked by required conditions
CI / test (push) Blocked by required conditions
CI / release-documentation (push) Blocked by required conditions
CI / release-artifacts (push) Blocked by required conditions
Some checks are pending
CI / release (push) Waiting to run
CI / debug (push) Waiting to run
CI / release_executable (push) Waiting to run
CI / debug_executable (push) Waiting to run
CI / check-phpunit (push) Waiting to run
CI / check-phpdoc (push) Waiting to run
CI / generate-phpdoc (push) Blocked by required conditions
CI / test (push) Blocked by required conditions
CI / release-documentation (push) Blocked by required conditions
CI / release-artifacts (push) Blocked by required conditions
This commit is contained in:
parent
92cabddc3b
commit
0f0858aa1e
1 changed files with 56 additions and 16 deletions
42
.github/workflows/ncc_workflow.yml
vendored
42
.github/workflows/ncc_workflow.yml
vendored
|
@ -294,7 +294,7 @@ jobs:
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
apt update -yqq
|
apt update -yqq
|
||||||
apt install git libpq-dev libzip-dev zip make wget gnupg -yqq
|
apt install git libpq-dev libzip-dev zip make wget gnupg curl docker.io docker-compose -yqq
|
||||||
curl -sSLf -o /usr/local/bin/install-php-extensions https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions
|
curl -sSLf -o /usr/local/bin/install-php-extensions https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions
|
||||||
chmod +x /usr/local/bin/install-php-extensions
|
chmod +x /usr/local/bin/install-php-extensions
|
||||||
install-php-extensions zip
|
install-php-extensions zip
|
||||||
|
@ -329,11 +329,51 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
ncc package install --package="release/net.nosial.socialbox.ncc" --build-source --reinstall -y --log-level debug
|
ncc package install --package="release/net.nosial.socialbox.ncc" --build-source --reinstall -y --log-level debug
|
||||||
|
|
||||||
|
- name: Deploy test environment
|
||||||
|
run: |
|
||||||
|
docker-compose -f docker-compose.test.yml up -d
|
||||||
|
|
||||||
|
- name: Wait for services to be available
|
||||||
|
run: |
|
||||||
|
# Function to check if a service is available
|
||||||
|
check_service() {
|
||||||
|
local url=$1
|
||||||
|
local max_attempts=200
|
||||||
|
local wait_seconds=5
|
||||||
|
local attempt=1
|
||||||
|
|
||||||
|
echo "Checking availability of $url"
|
||||||
|
|
||||||
|
while [ $attempt -le $max_attempts ]; do
|
||||||
|
response=$(curl -s -o /dev/null -w "%{http_code}" -f -H "Request-Type: ping" $url || echo "failed")
|
||||||
|
|
||||||
|
if [ "$response" = "200" ]; then
|
||||||
|
echo "Service at $url is available!"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Attempt $attempt/$max_attempts: Service at $url is not available yet (status: $response). Waiting $wait_seconds seconds..."
|
||||||
|
sleep $wait_seconds
|
||||||
|
attempt=$((attempt + 1))
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "Service at $url is not available after $max_attempts attempts."
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Check both services
|
||||||
|
check_service "http://127.0.0.1:8085/" && check_service "http://127.0.0.1:8086/"
|
||||||
|
|
||||||
- name: Run PHPUnit tests
|
- name: Run PHPUnit tests
|
||||||
run: |
|
run: |
|
||||||
wget https://phar.phpunit.de/phpunit-11.3.phar
|
wget https://phar.phpunit.de/phpunit-11.3.phar
|
||||||
php phpunit-11.3.phar --configuration phpunit.xml --log-junit reports/junit.xml --log-teamcity reports/teamcity --testdox-html reports/testdox.html --testdox-text reports/testdox.txt
|
php phpunit-11.3.phar --configuration phpunit.xml --log-junit reports/junit.xml --log-teamcity reports/teamcity --testdox-html reports/testdox.html --testdox-text reports/testdox.txt
|
||||||
|
|
||||||
|
- name: Stop test environment
|
||||||
|
run: |
|
||||||
|
docker-compose -f docker-compose.test.yml down
|
||||||
|
if: always() # Always run this step, even if previous steps fail
|
||||||
|
|
||||||
- name: Upload test reports
|
- name: Upload test reports
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
|
|
Loading…
Add table
Reference in a new issue