Feature/gha #9
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
name: Test Scaffold Testing Package | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
container: | |
image: php:8.3-cli | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install system dependencies | |
run: | | |
apt-get update && apt-get install -y \ | |
git \ | |
unzip \ | |
libzip-dev \ | |
tree \ | |
&& docker-php-ext-install zip | |
- name: Install Composer | |
run: | | |
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer | |
- name: Run tests | |
working-directory: /var/www/html | |
run: | | |
echo "Current directory structure before copy:" | |
pwd | |
ls -la $GITHUB_WORKSPACE | |
echo "phpunit.xml location:" | |
find $GITHUB_WORKSPACE -name phpunit.xml | |
# Copy project files to working directory | |
cp -r $GITHUB_WORKSPACE/. . | |
echo "Current directory structure after copy:" | |
pwd | |
ls -la | |
echo "Working directory phpunit.xml:" | |
find . -name phpunit.xml | |
# Install dependencies | |
composer install --no-interaction --no-progress | |
echo "Directory structure after composer install:" | |
tree -L 3 | |
# Run PHPUnit tests with debug | |
./vendor/bin/phpunit \ | |
-v \ | |
--debug \ | |
--configuration phpunit.xml \ | |
tests/Unit/ |