-
Notifications
You must be signed in to change notification settings - Fork 1
99 lines (82 loc) · 2.53 KB
/
tests.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
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Tests
on:
push:
branches:
- '2.x'
pull_request:
branches:
- '*'
permissions:
contents: read
jobs:
linux-tests:
runs-on: ubuntu-latest
container:
image: ${{ matrix.container }}
strategy:
fail-fast: false
matrix:
container:
- 'beinbm/cake:php80'
- 'beinbm/cake:php82'
db-type:
- mysql
- sqlite
services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: cakephp_test
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
memcached:
image: memcached
ports:
- 11211:11211
env:
DB: ${{ matrix.db-type }}
steps:
- name: Checkout
uses: actions/checkout@v3
# - name: Install PHP with extensions
# uses: shivammathur/setup-php@v2
# with:
# php-version: ${{ matrix.php-version }}
# extensions: apcu, memcache, memcached, mcrypt, pdo_mysql, pdo_sqlite
# ini-values: |
# assert.exception=1,
# zend.assertions=1,
# error_reporting=-1,
# log_errors_max_len=0,
# display_errors=On,
# apc.enable_cli=1
# tools: composer
# - name: locale-gen
# run: |
# sudo locale-gen de_DE;
# sudo locale-gen es_ES;
# - name: Create Another Databases for MySQL
# if: matrix.db-type == 'mysql'
# run: |
# env MYSQL_PWD=root mysql -h 127.0.0.1 -u root -e 'CREATE DATABASE cakephp_test2;';
# env MYSQL_PWD=root mysql -h 127.0.0.1 -u root -e 'CREATE DATABASE cakephp_test3;';
- name: Make temporary directories writable
run: chmod -R 777 ./app/tmp
- name: Get composer directory path
id: composer-path
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer
id: composer-cache
uses: actions/cache@v3
with:
path: ${{ steps.composer-path.outputs.dir }}
key: ${{ matrix.container }}-composer-${{ hashFiles('**/composer.json') }}
- name: Install Composer Packages
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --no-ansi --no-interaction --no-progress
- name: Copy database.php
run: cp ./.github/workflows/configs/database.php ./app/Config/
- name: Run Tests
run: ./vendor/bin/phpunit