-
Notifications
You must be signed in to change notification settings - Fork 1
86 lines (75 loc) · 2.7 KB
/
ci.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
77
78
79
80
81
82
83
84
85
86
name: CI
on:
push:
branches:
- main
- dev
pull_request:
branches:
- '**'
jobs:
build:
services:
db:
image: ${{ matrix.db }}
env:
MYSQL_DATABASE: twyne_test
MYSQL_ROOT_PASSWORD: testpwd
ports:
- '3306:3306'
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
matrix:
os: [ 'ubuntu-latest' ]
# All supported PHP versions (only dropping unsupported when necessary). https://www.php.net/supported-versions.php
php: [ '7.4', '8.0', '8.1', '8.2' ]
# MariaDB: Oldest and newest supported. https://mariadb.org/download
# MySQL: previous and current GA versions. https://dev.mysql.com/downloads/mysql/
db: [ 'mariadb:10.3.37', 'mariadb:10.10.2', 'mysql:5.7', 'mysql:8.0' ]
runs-on: ${{ matrix.os }}
name: PHP ${{ matrix.php }} on ${{ matrix.os }} with ${{ matrix.db }}
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{matrix.php}}
extensions: fileinfo, json, pdo, mysql, pdo_mysql, mbstring
- name: Install
env:
APP_ENV: test
# The database server version has to be specified in the format:
# ^(?:5\.5\.5-)?(mariadb-)?<major_version>.<minor_version>.<patch_version>
# This differs from what's in the matrix, so we do it manually below.
run: |
export SERVER_VERSION="8.0"
if [ "${{ matrix.db }}" = "mariadb:10.3.37" ]; then
SERVER_VERSION="mariadb-10.3.37"
elif [ "${{ matrix.db }}" = "mariadb:10.10.2" ]; then
SERVER_VERSION="mariadb-10.11.1"
elif [ "${{ matrix.db }}" = "mysql:5.7" ]; then
SERVER_VERSION="5.7"
fi
export DATABASE_URL="mysql://root:[email protected]:3306/twyne_test?serverVersion=$SERVER_VERSION"
echo DATABASE_URL is: $DATABASE_URL
if [ "$SERVER_VERSION" = "8.0" ]; then
sudo mysql --host 127.0.0.1 -uroot -ptestpwd -e "ALTER USER root IDENTIFIED WITH mysql_native_password BY 'testpwd';"
fi
echo DATABASE_URL=$DATABASE_URL > .env.test.local
sudo apt-get update -q
sudo apt-get --fix-broken install
sudo apt-get install -y exiftool shellcheck
composer install
./bin/console doctrine:migrations:migrate
npm ci
- name: Test
run: |
composer test
npm run test
shellcheck bin/deploy.sh
- name: Build and check assets
run: |
npm run build
git diff
git status | grep "nothing to commit, working tree clean"