-
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (57 loc) · 1.76 KB
/
Copy pathtesting-mysql.yml
File metadata and controls
65 lines (57 loc) · 1.76 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
---
on: # yamllint disable-line rule:truthy
pull_request: null
push:
branches:
- master
- main
- '*.*'
- '*.*.*'
name: 🛢️ MySQL
jobs:
acceptance:
name: MySQL · PHP ${{ matrix.php-version }}
timeout-minutes: 8
runs-on: ubuntu-latest
concurrency:
cancel-in-progress: true
group: mysql-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ matrix.php-version }}
strategy:
fail-fast: false
matrix:
php-version:
- '8.2'
- '8.3'
- '8.4'
steps:
- name: 📦 Check out the codebase
uses: actions/checkout@v5
- name: 🛠️ Start MySQL
run: docker compose -f tests/docker-compose.yml up -d cycle-mysql
- name: 🛠️ Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, pdo, pdo_sqlite, pdo_mysql
ini-values: error_reporting=E_ALL
- name: 📥 Install dependencies with composer
uses: ramsey/composer-install@v3
with:
dependency-versions: highest
- name: ⏳ Wait for MySQL
run: |
for i in $(seq 1 30); do
if docker exec $(docker ps -qf "ancestor=mysql:8.0.37") mysqladmin ping -h 127.0.0.1 --silent; then
echo "MySQL is up"; exit 0
fi
echo "Waiting for MySQL... ($i)"; sleep 2
done
echo "MySQL did not become ready in time"; exit 1
- name: 🧪 Run acceptance tests (MySQL)
env:
DB_HOSTNAME: 127.0.0.1
DB_PORT: 13306
DB_USER: root
DB_PASSWORD: 'YourStrong!Passw0rd'
DB_DATABASE: spiral
run: composer test:mysql