-
Notifications
You must be signed in to change notification settings - Fork 0
138 lines (116 loc) · 3.48 KB
/
Copy pathdeploy-application.yml
File metadata and controls
138 lines (116 loc) · 3.48 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: Deploy Application
on:
push:
branches:
- '*'
jobs:
create-deployment-artifact:
name: Create Deployment Artifact
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.5
tools: composer
- name: Install PHP Dependencies
working-directory: ./admin
run: |
composer install --no-interaction --prefer-dist --optimize-autoloader
- name: Compile CSS and JavaScript
working-directory: ./admin
run: |
npm ci
npm run build
- name: Setup Environment
working-directory: ./admin
run: |
cp .env.example .env
php artisan key:generate
- name: Run Pint Test
working-directory: ./admin
run: |
./vendor/bin/pint --test
- name: Run Pest Tests
working-directory: ./admin
run: |
./vendor/bin/pest
- name: Run PHPStan Analysis
working-directory: ./admin
run: |
./vendor/bin/phpstan --memory-limit=2048M analyse
create-deployment-artifact-shop:
name: Create Deployment Artifact (Shop)
runs-on: ubuntu-latest
# The shop reads the admin-owned database, so tests need that schema.
# We stand up Postgres, build the schema with admin's migrations, then run
# the shop test suite against it.
services:
postgres:
image: postgres:16
env:
POSTGRES_DB: shop_flow_test
POSTGRES_USER: shop_flow
POSTGRES_PASSWORD: password
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U shop_flow"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
DB_CONNECTION: pgsql
DB_HOST: 127.0.0.1
DB_PORT: 5432
DB_DATABASE: shop_flow_test
DB_USERNAME: shop_flow
DB_PASSWORD: password
steps:
- uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.5
tools: composer
extensions: pdo_pgsql, pgsql
- name: Build shared schema (admin migrations)
working-directory: ./admin
run: |
composer install --no-interaction --prefer-dist --optimize-autoloader
cp .env.example .env
php artisan key:generate
php artisan migrate --force
php artisan db:seed --class="Database\\Seeders\\SettingSeeder" --force
- name: Install PHP Dependencies
working-directory: ./shop
run: |
composer install --no-interaction --prefer-dist --optimize-autoloader
- name: Compile CSS and JavaScript
working-directory: ./shop
run: |
npm ci
npm run build
- name: Run Frontend Lint & Format Check
working-directory: ./shop
run: |
npm run lint
npm run format:check
- name: Setup Environment
working-directory: ./shop
run: |
cp .env.example .env
php artisan key:generate
- name: Run Pint Test
working-directory: ./shop
run: |
./vendor/bin/pint --test
- name: Run Pest Tests
working-directory: ./shop
run: |
./vendor/bin/pest
- name: Run PHPStan Analysis
working-directory: ./shop
run: |
./vendor/bin/phpstan --memory-limit=2048M analyse