forked from sai-gillingham/next-poc-react
-
Notifications
You must be signed in to change notification settings - Fork 1
111 lines (100 loc) · 5.45 KB
/
e2e.yml
File metadata and controls
111 lines (100 loc) · 5.45 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
name: E2E test for EC-CUBE
on:
push:
branches:
- '**'
tags:
- '**'
paths:
- '**'
- '!*.md'
pull_request:
paths:
- '**'
- '!*.md'
workflow_dispatch:
inputs:
eccube-api-repository:
description: 'EC-CUBE API REPOSITORY'
default: 'https://github.com/EC-CUBE/eccube-api4.git'
required: false
eccube-api-branch:
description: 'EC-CUBE API BRANCH'
default: 'next-poc'
required: false
env:
API_REPOSITORY: ${{ inputs.eccube-api-repository || 'https://github.com/EC-CUBE/eccube-api4.git' }}
API_BRANCH: ${{ inputs.eccube-api-branch || 'next-poc' }}
jobs:
e2e:
name: E2E
runs-on: ubuntu-22.04
strategy:
fail-fast: false
services:
postgres:
image: postgres:14
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
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
mailcatcher:
image: schickling/mailcatcher
ports:
- 1080:1080
- 1025:1025
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
- name: Setup EC-CUBE
run: |
git clone https://github.com/EC-CUBE/next-poc.git ec-cube
cd ec-cube
composer install
echo "APP_ENV=prod
APP_DEBUG=0
TRUSTED_HOSTS=^127\.0\.0\.1$,^localhost$
DATABASE_URL=postgres://postgres:password@127.0.0.1:5432/eccube_db
DATABASE_SERVER_VERSION=14
MAILER_DSN=smtp://127.0.0.1:1025" > .env
bin/console doctrine:database:create
bin/console doctrine:schema:create
bin/console eccube:fixtures:load
- name: Setup EC-CUBE API Plugin
working-directory: ec-cube
run: |
git clone -b ${API_BRANCH} ${API_REPOSITORY}
sed -i 's/"extra": {/"extra": { "id": 123,/g' eccube-api4/composer.json
bin/console eccube:composer:require ec-cube/api42 --from=./eccube-api4
bin/console eccube:plugin:enable --code Api42
bin/console doctrine:schema:update --dump-sql -f # プラグイン有効化時に何故かoauth2のテーブルが生成されないので
bin/console doctrine:query:sql "INSERT INTO oauth2_client (name, secret, redirect_uris, grants, scopes, active, allow_plain_text_pkce, identifier) VALUES ('', NULL, 'http://localhost', 'password refresh_token', 'read:Authority write:Authority read:AuthorityRole write:AuthorityRole read:BaseInfo write:BaseInfo read:Block write:Block read:BlockPosition write:BlockPosition read:Cart write:Cart read:CartItem write:CartItem read:Category write:Category read:ClassCategory write:ClassCategory read:ClassName write:ClassName read:Country write:Country read:Csv write:Csv read:CsvType write:CsvType read:Customer write:Customer read:CustomerAddress write:CustomerAddress read:CustomerFavoriteProduct write:CustomerFavoriteProduct read:CustomerOrderStatus write:CustomerOrderStatus read:CustomerStatus write:CustomerStatus read:Delivery write:Delivery read:DeliveryDuration write:DeliveryDuration read:DeliveryFee write:DeliveryFee read:DeliveryTime write:DeliveryTime read:DeviceType write:DeviceType read:Job write:Job read:Layout write:Layout read:MailHistory write:MailHistory read:MailTemplate write:MailTemplate read:Member write:Member read:News write:News read:Order write:Order read:OrderItem write:OrderItem read:OrderItemType write:OrderItemType read:OrderPdf write:OrderPdf read:OrderStatus write:OrderStatus read:OrderStatusColor write:OrderStatusColor read:Page write:Page read:PageLayout write:PageLayout read:PageMax write:PageMax read:Payment write:Payment read:PaymentOption write:PaymentOption read:Plugin write:Plugin read:Pref write:Pref read:Product write:Product read:ProductCategory write:ProductCategory read:ProductClass write:ProductClass read:ProductImage write:ProductImage read:ProductListMax write:ProductListMax read:ProductListOrderBy write:ProductListOrderBy read:ProductStatus write:ProductStatus read:ProductStock write:ProductStock read:ProductTag write:ProductTag read:RoundingType write:RoundingType read:SaleType write:SaleType read:Sex write:Sex read:Shipping write:Shipping read:Tag write:Tag read:TaxDisplayType write:TaxDisplayType read:TaxRule write:TaxRule read:TaxType write:TaxType read:Template write:Template read:Work write:Work', true, false, '121ecaab37f52176ef2b7ce9dfca872b');"
- name: Start PHP Development Server
working-directory: ec-cube
run: |
php -S localhost:8080 &
- name: Start EC-CUBE Client
run: |
sed -i 's/<<API_CLIENT_KEY>>/121ecaab37f52176ef2b7ce9dfca872b/g' .env.development
sed -i 's|$REACT_APP_API_URL|http://localhost:8080|g' .env.development
cp .env.development .env
npm ci
echo a | node tools/EccubeReactBuilder.js
npx react-scripts start &
npx wait-on http://127.0.0.1:3000
- name: Start E2E Tests
run: |
rm -rf ec-cube/zap # ec-cube本体のplaywrightが実行されてしまうので削除
npx playwright install
npx playwright test