-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (63 loc) · 2.01 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
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 "Debug workspace paths:"
echo "GITHUB_WORKSPACE: $GITHUB_WORKSPACE"
echo "Current directory: $(pwd)"
echo "Workspace contents:"
ls -la $GITHUB_WORKSPACE
# Copy project files to working directory
cp -r $GITHUB_WORKSPACE/. .
echo "Current directory structure after copy:"
pwd
ls -la
# Create phpunit.xml
cat > phpunit.xml << 'EOL'
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true">
<testsuites>
<testsuite name="Unit">
<directory>tests/Unit</directory>
</testsuite>
</testsuites>
</phpunit>
EOL
echo "PHPUnit config contents:"
cat 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/