-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (34 loc) · 1.28 KB
/
Copy pathtest.yml
File metadata and controls
40 lines (34 loc) · 1.28 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
name: Automated tests
on: [push]
jobs:
test:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:9.0
env:
# The MySQL docker container requires these environment variables to be set
# so we can create and migrate the test database.
# See: https://hub.docker.com/_/mysql
MYSQL_DATABASE: testdb
MYSQL_ROOT_PASSWORD: testrootpass
ports:
# Opens port 3306 on service container and host
# https://docs.github.com/en/actions/using-containerized-services/about-service-containers
- 3306:3306
# Before continuing, verify the mysql container is reachable from the ubuntu host
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
- name: Validate composer.json and composer.lock
run: composer validate
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Run test suite
run: composer run test
env:
MYTS_DSN: mysql:host=127.0.0.1;dbname=testdb;user=root;password=testrootpass;charset=utf8