-
Notifications
You must be signed in to change notification settings - Fork 13
118 lines (106 loc) · 4.21 KB
/
Copy pathtest.yaml
File metadata and controls
118 lines (106 loc) · 4.21 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
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# @see https://github.com/kurozumi
name: CI/CD for EC-CUBE4 Plugin
on: [workflow_dispatch, pull_request]
env:
PLUGIN_NAME: DataMigration4
jobs:
phpunit:
name: PHPUnit
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
eccube-versions: ['4.0','4.1']
php-versions: [7.1,7.2,7.3,7.4]
database: [mysql, pgsql]
include:
- database: mysql
database_url: mysql://root:root@127.0.0.1:3306/eccube_db
database_server_version: 5
- database: pgsql
database_url: postgres://postgres:password@127.0.0.1:5432/eccube_db
database_server_version: 11
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_USER: root
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: eccube_db
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
postgres:
image: postgres:11
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: eccube_db
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Checkout EC-CUBE
uses: actions/checkout@v2
with:
repository: EC-CUBE/ec-cube
ref: ${{ matrix.eccube-versions }}
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@master #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, xml, ctype, iconv, mysql, intl, zip, pgsql
tools: composer:v2
- if: matrix.eccube-versions == '4.0'
run: sudo composer selfupdate --1
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.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 --no-suggest --prefer-dist --optimize-autoloader
composer require pear/pear-core-minimal:^1.10.10 pear/archive_tar:^1.4.13 wapmorgan/unified-archive:^1.1.1 nobuhiko/bulk-insert-query
- name: Install Composer eccube4-test-fixer
if: matrix.eccube-versions == '4.0'
run : |
composer require --dev kiy0taka/eccube4-test-fixer
- name: Checkout
uses: actions/checkout@v2
with:
path: app/Plugin/DataMigration4
- name: Setup EC-CUBE and Plugin
run: |
composer compile
bin/console eccube:plugin:install --code $PLUGIN_NAME
bin/console cache:clear --no-warmup
bin/console eccube:plugin:enable --code $PLUGIN_NAME
env:
DATABASE_URL: ${{ matrix.database_url }}
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
- name: Run Tests for EC-CUBE4.0
if: matrix.eccube-versions == '4.0'
run: |
find app/Plugin/$PLUGIN_NAME/Tests -name "*Test.php" | while read TESTCASE
do
bin/phpunit --include-path vendor/kiy0taka/eccube4-test-fixer/src --loader 'Eccube\PHPUnit\Loader\Eccube4CompatTestSuiteLoader' ${TESTCASE}
done
env:
DATABASE_URL: ${{ matrix.database_url }}
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
- name: Run Tests for EC-CUBE4.1
if: matrix.eccube-versions != '4.0'
run: |
bin/phpunit app/Plugin/$PLUGIN_NAME/Tests
env:
DATABASE_URL: ${{ matrix.database_url }}
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}