-
-
Notifications
You must be signed in to change notification settings - Fork 18
81 lines (67 loc) · 2.51 KB
/
tests.yml
File metadata and controls
81 lines (67 loc) · 2.51 KB
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
77
78
79
80
81
name: bowphp
on: [ push, pull_request ]
env:
AWS_KEY: ${{ secrets.AWS_KEY }}
AWS_SECRET: ${{ secrets.AWS_SECRET }}
AWS_ENDPOINT: ${{ secrets.AWS_ENDPOINT }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
AWS_REGION: ${{ secrets.AWS_REGION }}
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
jobs:
lunix-tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
php: [8.1, 8.2, 8.3, 8.4]
os: [ubuntu-latest]
stability: [prefer-lowest, prefer-stable]
name: PHP ${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, mysql, sqlite, pgsql, pdo_mysql, pdo_pgsql, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, redis
coverage: none
- name: Set Docker containers
run: docker compose up -d
- name: Wait for MySQL to be ready
run: |
echo "Waiting for MySQL to be ready..."
for i in {1..30}; do
if docker exec bowphp_mysql mysqladmin ping -h localhost -u root -ppassword --silent 2>/dev/null; then
echo "MySQL is ready!"
break
fi
echo "Waiting for MySQL... ($i/30)"
sleep 2
done
- name: Wait for PostgreSQL to be ready
run: |
echo "Waiting for PostgreSQL to be ready..."
for i in {1..30}; do
if docker exec bowphp_postgres pg_isready -U postgres --silent 2>/dev/null; then
echo "PostgreSQL is ready!"
break
fi
echo "Waiting for PostgreSQL... ($i/30)"
sleep 2
done
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
- name: Copy the php ini config
run: sudo cp php.dist.ini php.ini
- name: Install dependencies
run: sudo composer update --prefer-dist --no-interaction
- name: Create test cache directory
run: if [ ! -d /tmp/bowphp_testing ]; then mkdir -p /tmp/bowphp_testing; fi;
- name: Run test suite
run: ./vendor/bin/phpunit tests --configuration phpunit.dist.xml