62 lines (62 loc) · 2.35 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
name: test
on:
push:
branches: [ master, main ]
pull_request:
branches: [ master, main ]
jobs:
phpunit:
name: PHP ${{ matrix.php-versions }}
runs-on: ubuntu-latest
env:
PHP_CS_FIXER_IGNORE_ENV: 1
services:
mysql:
image: mariadb:10.3
env:
MYSQL_ROOT_PASSWORD: thelia
MYSQL_DATABASE: thelia
ports:
- 3306/tcp
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
fail-fast: false
matrix:
php-versions: ['8.1', '8.2']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Environment
run: |
sudo apt-get update
sudo apt-get install sendmail
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
ini-values: post_max_size=20M
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, mysql, gd, zip
- name: Start mysql service
run: sudo /etc/init.d/mysql start
- name: Get composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer dependencies
run: |
composer install --no-progress --prefer-dist --optimize-autoloader
composer update --no-interaction --prefer-dist
- name: Install Thelia
run: |
php Thelia thelia:install --env=test --db_host=127.0.0.1:${{ job.services.mysql.ports['3306'] }} --db_username=root --db_name=thelia --db_password=thelia
php Thelia module:refresh --env=test
php Thelia admin:create --env=test --login_name thelia2 --password thelia2 --last_name thelia2 --first_name thelia2 --email thelia2@example.com
- name: Run CI
run: composer ci