Skip to content

Commit 1ef9911

Browse files
CIの更新
1 parent c73d884 commit 1ef9911

File tree

1 file changed

+113
-122
lines changed

1 file changed

+113
-122
lines changed

.github/workflows/main.yml

Lines changed: 113 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI for RelatedProduct4
1+
name: CI for RelatedProduct42
22
on:
33
push:
44
branches:
@@ -22,38 +22,42 @@ jobs:
2222
fail-fast: false
2323
matrix:
2424
operating-system: [ ubuntu-18.04 ]
25-
php: [ '7.1', '7.2', '7.3', '7.4' ]
26-
db: [ mysql, pgsql ]
27-
eccube_version: [ '4.0.6-p1', '4.1' ]
28-
plugin_code: [ 'RelatedProduct4' ]
25+
php: [ '7.4', '8.0', '8.1' ]
26+
db: [ 'mysql', 'mysql8', 'pgsql' ]
27+
eccube_version: [ '4.2' ]
28+
plugin_code: [ 'RelatedProduct42' ]
2929
include:
30-
- eccube_version: '4.0.6-p1'
31-
composer: 'v1'
32-
- eccube_version: '4.1'
33-
composer: 'v2'
3430
- db: mysql
35-
dbport: '3306'
36-
dbuser: 'root'
37-
dbpass: 'root'
38-
dbname: 'myapp_test'
39-
dbversion: 5.7
31+
database_url: mysql://root:password@127.0.0.1:3306/eccube_db
32+
database_server_version: 5.7
33+
database_charset: utf8mb4
34+
- db: mysql8
35+
database_url: mysql://root:password@127.0.0.1:3308/eccube_db
36+
database_server_version: 8
37+
database_charset: utf8mb4
4038
- db: pgsql
41-
dbport: '5432'
42-
dbuser: 'postgres'
43-
dbpass: 'password'
44-
dbname: 'myapp_test'
45-
dbversion: 9.5
39+
database_url: postgres://postgres:password@127.0.0.1:5432/eccube_db
40+
database_server_version: 14
41+
database_charset: utf8
4642
services:
4743
mysql:
4844
image: mysql:5.7
4945
env:
50-
MYSQL_ROOT_PASSWORD: root
46+
MYSQL_ROOT_PASSWORD: password
5147
MYSQL_DATABASE: ${{ matrix.dbname }}
5248
ports:
5349
- 3306:3306
5450
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
51+
mysql8:
52+
image: mysql:8
53+
env:
54+
MYSQL_ROOT_PASSWORD: password
55+
MYSQL_DATABASE: ${{ matrix.dbname }}
56+
ports:
57+
- 3308:3306
58+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
5559
postgres:
56-
image: postgres:9.5
60+
image: postgres:14
5761
env:
5862
POSTGRES_USER: postgres
5963
POSTGRES_PASSWORD: password
@@ -68,110 +72,97 @@ jobs:
6872
- 1080:1080
6973
- 1025:1025
7074
steps:
71-
- run: sudo apt-get purge -y hhvm
72-
- name: Checkout
73-
uses: actions/checkout@v2
74-
75-
- name: Setup PHP
76-
uses: nanasess/setup-php@master
77-
with:
78-
php-version: ${{ matrix.php }}
79-
80-
- name: Archive Plugin
81-
env:
82-
PLUGIN_CODE: ${{ matrix.plugin_code }}
83-
run: |
84-
tar cvzf ${GITHUB_WORKSPACE}/${PLUGIN_CODE}.tar.gz ./*
85-
- name: Checkout EC-CUBE
86-
uses: actions/checkout@v2
87-
with:
88-
repository: 'EC-CUBE/ec-cube'
89-
ref: ${{ matrix.eccube_version }}
90-
path: 'ec-cube'
91-
92-
- name: Get Composer Cache Directory
93-
id: composer-cache
94-
run: |
95-
echo "::set-output name=dir::$(composer config cache-files-dir)"
96-
97-
- uses: actions/cache@v1
98-
with:
99-
path: ${{ steps.composer-cache.outputs.dir }}
100-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
101-
restore-keys: |
102-
${{ runner.os }}-composer-
103-
104-
- if: matrix.composer == 'v1'
105-
run: sudo composer selfupdate --1
75+
- run: sudo apt-get purge -y hhvm
76+
- name: Checkout
77+
uses: actions/checkout@v2
10678

107-
- name: Install to composer
108-
working-directory: 'ec-cube'
109-
run: composer install --no-interaction -o --apcu-autoloader
79+
- name: Setup PHP
80+
uses: nanasess/setup-php@master
81+
with:
82+
php-version: ${{ matrix.php }}
11083

111-
- if: matrix.composer == 'v1'
112-
working-directory: 'ec-cube'
113-
run: composer require kiy0taka/eccube4-test-fixer "dev-main@dev"
114-
115-
- name: Setup EC-CUBE
116-
env:
117-
DB: ${{ matrix.db }}
118-
USER: ${{ matrix.dbuser }}
119-
DBUSER: ${{ matrix.dbuser }}
120-
DBPASS: ${{ matrix.dbpass }}
121-
DBNAME: ${{ matrix.dbname }}
122-
DBPORT: ${{ matrix.dbport }}
123-
DBSERVER: 127.0.0.1
124-
DBVERSION: ${{ matrix.dbversion }}
125-
ROOT_URLPATH: /ec-cube/html
126-
working-directory: 'ec-cube'
127-
run: |
128-
export PGPASSWORD=${DBPASS}
129-
echo "APP_ENV=prod" > .env
130-
echo "APP_DEBUG=0" >> .env
131-
echo "DATABASE_URL=${DB}://${DBUSER}:${DBPASS}@${DBSERVER}/${DBNAME}" >> .env
132-
echo "DATABASE_SERVER_VERSION=${DBVERSION}" >> .env
133-
echo "MAILER_URL=smtp://127.0.0.1:1025" >> .env
134-
echo "HTTP_SITEURL=https://localhost" >> .env
135-
echo "USE_SELFSIGNED_SSL_CERTIFICATE=1" >> .env
136-
cat .env
137-
bin/console doctrine:schema:create
138-
bin/console eccube:fixtures:load
139-
140-
- name: Setup Plugin
141-
env:
142-
PLUGIN_CODE: ${{ matrix.plugin_code }}
143-
working-directory: 'ec-cube'
144-
run: |
145-
bin/console eccube:plugin:install --code=${PLUGIN_CODE} --path=${GITHUB_WORKSPACE}/${PLUGIN_CODE}.tar.gz
146-
bin/console eccube:plugin:enable --code=${PLUGIN_CODE}
147-
rm codeception/_support/*Tester.php
84+
- name: Archive Plugin
85+
env:
86+
PLUGIN_CODE: ${{ matrix.plugin_code }}
87+
run: |
88+
tar cvzf ${GITHUB_WORKSPACE}/${PLUGIN_CODE}.tar.gz ./*
89+
- name: Checkout EC-CUBE
90+
uses: actions/checkout@v2
91+
with:
92+
repository: 'EC-CUBE/ec-cube'
93+
ref: ${{ matrix.eccube_version }}
94+
path: 'ec-cube'
14895

149-
- name: Run PHPUnit
150-
if: matrix.composer == 'v2'
151-
env:
152-
PLUGIN_CODE: ${{ matrix.plugin_code }}
153-
working-directory: 'ec-cube'
154-
run: bin/phpunit -c app/Plugin/${PLUGIN_CODE}/phpunit.xml.dist app/Plugin/${PLUGIN_CODE}/Tests
96+
- name: Get Composer Cache Directory
97+
id: composer-cache
98+
run: |
99+
echo "::set-output name=dir::$(composer config cache-files-dir)"
100+
- uses: actions/cache@v1
101+
with:
102+
path: ${{ steps.composer-cache.outputs.dir }}
103+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
104+
restore-keys: |
105+
${{ runner.os }}-composer-
106+
- name: Install to composer
107+
working-directory: 'ec-cube'
108+
run: composer install --no-interaction -o --apcu-autoloader
155109

156-
- name: Run PHPUnit
157-
if: matrix.composer == 'v1'
158-
env:
159-
PLUGIN_CODE: ${{ matrix.plugin_code }}
160-
working-directory: 'ec-cube'
161-
run: |
162-
find app/Plugin/${PLUGIN_CODE}/Tests -name "*Test.php" | while read TESTCASE
163-
do
164-
./vendor/bin/phpunit -c app/Plugin/${PLUGIN_CODE}/phpunit.xml.dist --include-path vendor/kiy0taka/eccube4-test-fixer/src --loader 'Eccube\PHPUnit\Loader\Eccube4CompatTestSuiteLoader' ${TESTCASE}
165-
done
110+
- name: Setup EC-CUBE
111+
env:
112+
APP_ENV: 'test'
113+
APP_DEBUG: 0
114+
DATABASE_URL: ${{ matrix.database_url }}
115+
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
116+
DATABASE_CHARSET: ${{ matrix.database_charset }}
117+
working-directory: 'ec-cube'
118+
run: |
119+
bin/console doctrine:database:create
120+
bin/console doctrine:schema:create
121+
bin/console eccube:fixtures:load
122+
- name: Setup Plugin
123+
env:
124+
APP_ENV: 'test'
125+
APP_DEBUG: 0
126+
DATABASE_URL: ${{ matrix.database_url }}
127+
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
128+
DATABASE_CHARSET: ${{ matrix.database_charset }}
129+
PLUGIN_CODE: ${{ matrix.plugin_code }}
130+
working-directory: 'ec-cube'
131+
run: |
132+
bin/console eccube:plugin:install --code=${PLUGIN_CODE} --path=${GITHUB_WORKSPACE}/${PLUGIN_CODE}.tar.gz
133+
bin/console cache:clear --no-warmup
134+
bin/console eccube:plugin:enable --code=${PLUGIN_CODE}
135+
- name: Run PHPUnit
136+
env:
137+
APP_ENV: 'test'
138+
APP_DEBUG: 0
139+
DATABASE_URL: ${{ matrix.database_url }}
140+
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
141+
DATABASE_CHARSET: ${{ matrix.database_charset }}
142+
PLUGIN_CODE: ${{ matrix.plugin_code }}
143+
working-directory: 'ec-cube'
144+
run: |
145+
bin/console cache:clear --no-warmup
146+
bin/phpunit -c app/Plugin/${PLUGIN_CODE}/phpunit.xml.dist app/Plugin/${PLUGIN_CODE}/Tests
166147
167-
- name: Disable Plugin
168-
working-directory: 'ec-cube'
169-
env:
170-
PLUGIN_CODE: ${{ matrix.plugin_code }}
171-
run: bin/console eccube:plugin:disable --code=${PLUGIN_CODE}
148+
- name: Disable Plugin
149+
working-directory: 'ec-cube'
150+
env:
151+
APP_ENV: 'test'
152+
APP_DEBUG: 0
153+
DATABASE_URL: ${{ matrix.database_url }}
154+
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
155+
DATABASE_CHARSET: ${{ matrix.database_charset }}
156+
PLUGIN_CODE: ${{ matrix.plugin_code }}
157+
run: bin/console eccube:plugin:disable --code=${PLUGIN_CODE}
172158

173-
- name: Uninstall Plugin
174-
env:
175-
PLUGIN_CODE: ${{ matrix.plugin_code }}
176-
working-directory: 'ec-cube'
177-
run: bin/console eccube:plugin:uninstall --code=${PLUGIN_CODE}
159+
- name: Uninstall Plugin
160+
env:
161+
APP_ENV: 'test'
162+
APP_DEBUG: 0
163+
DATABASE_URL: ${{ matrix.database_url }}
164+
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
165+
DATABASE_CHARSET: ${{ matrix.database_charset }}
166+
PLUGIN_CODE: ${{ matrix.plugin_code }}
167+
working-directory: 'ec-cube'
168+
run: bin/console eccube:plugin:uninstall --code=${PLUGIN_CODE}

0 commit comments

Comments
 (0)