Some checks failed
CI Demo / build (push) Successful in 3s
Docker Test / docker-ops (push) Successful in 4s
.NET Test / dotnet-test (push) Failing after 18s
Go Test / go-test (push) Failing after 5s
Java Test / java-hello (push) Successful in 31s
Julia Test / julia-test (push) Failing after 15s
Node.js Test / nodejs-test (push) Has been cancelled
Notebook Test / nb-test (push) Has been cancelled
PHP Test / php-test (push) Has been cancelled
Python Test / python-hello (push) Has been cancelled
R Test / r-cmdcheck (push) Has been cancelled
Rust Test / rust-test (push) Has been cancelled
Scala Test / scala-test (push) Has been cancelled
Kotlin Test / kotlin-hello (push) Has been cancelled
Swift Test / swift-hello (push) Has been cancelled
37 lines
1.1 KiB
YAML
37 lines
1.1 KiB
YAML
name: PHP Test
|
|
on: [push]
|
|
|
|
jobs:
|
|
php-test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up PHP
|
|
uses: shivammathur/setup-php@20169f80b72fbb73ec98664e85c82f0946b89868
|
|
|
|
- name: Verify PHP & Composer
|
|
run: |
|
|
php -v
|
|
composer --version
|
|
|
|
# If there is a composer.json, install deps; otherwise skip gracefully
|
|
- name: Install dependencies (if composer.json exists)
|
|
run: |
|
|
if [ -f composer.json ]; then
|
|
composer install --prefer-dist --no-interaction --no-progress
|
|
else
|
|
echo "No composer.json found; skipping composer install."
|
|
fi
|
|
|
|
# If PHPUnit config exists, run tests; else just print Hello
|
|
- name: Run tests or Hello, PHP!
|
|
run: |
|
|
if [ -f vendor/bin/phpunit ] || [ -f phpunit.xml ] || [ -f phpunit.xml.dist ]; then
|
|
vendor/bin/phpunit --no-coverage || vendor/bin/phpunit --no-coverage
|
|
else
|
|
echo '<?php echo "Hello, PHP!\\n";' > index.php
|
|
php index.php
|
|
fi
|