1+ name : Build
2+
3+ on :
4+ push :
5+ branches : ['*']
6+ pull_request :
7+ branches : ['*']
8+ schedule :
9+ - cron : " 0 0 * * 5"
10+
11+ jobs :
12+ PHPUnit-MySQL :
13+
14+ strategy :
15+ fail-fast : false
16+ matrix :
17+ php_versions : ['7.1', '7.2', '7.3', '7.4']
18+
19+ runs-on : ubuntu-latest
20+ name : PHPUnit - PHP ${{ matrix.php_versions }} - MySQL
21+
22+ env :
23+ TEST_DB : default
24+ UF_MODE : debug
25+ DB_DRIVER : mysql
26+ DB_HOST : 127.0.0.1
27+ DB_USER : userfrosting
28+ DB_PASSWORD : password
29+ DB_NAME : userfrosting
30+ DB_PORT : 3306
31+
32+ steps :
33+ - uses : actions/checkout@v2
34+
35+ - name : Setup PHP, with composer and extensions
36+ uses : shivammathur/setup-php@v2
37+ with :
38+ php-version : ${{ matrix.php_versions }}
39+ extensions : mbstring, dom, fileinfo, gd, memcached, redis, pdo_sqlite
40+ coverage : xdebug
41+ tools : pecl, composer:v1
42+
43+ - uses : actions/setup-node@v2
44+ with :
45+ node-version : 10
46+
47+ - name : Setup Redis-server
48+ uses :
supercharge/[email protected] 49+ with :
50+ redis-version : 6
51+
52+ - name : Setup Memcached
53+ uses : niden/actions-memcached@v7
54+
55+ - name : Shutdown Ubuntu MySQL (SUDO)
56+ run : sudo service mysql stop # Shutdown the Default MySQL, "sudo" is necessary, please not remove it
57+
58+ - name : Set up MySQL (PHP <= 7.3 -> MySQL 5)
59+ if : ${{ matrix.php_versions != 7.4 }}
60+ uses :
mirromutth/[email protected] 61+ with :
62+ mysql version : ' 5'
63+ mysql database : ' userfrosting'
64+ mysql user : ' userfrosting'
65+ mysql password : ' password'
66+
67+ - name : Set up MySQL (PHP >= 7.4 -> MySQL 8)
68+ if : ${{ matrix.php_versions == 7.4 }}
69+ uses :
mirromutth/[email protected] 70+ with :
71+ mysql version : ' 8'
72+ mysql database : ' userfrosting'
73+ mysql user : ' userfrosting'
74+ mysql password : ' password'
75+
76+ - name : Wait for MySQL
77+ run : |
78+ while ! mysqladmin ping --host=127.0.0.1 --password=password --silent; do
79+ sleep 1
80+ done
81+
82+ - name : Copy .env
83+ run : php -r "copy('app/sprinkles.example.json', 'app/sprinkles.json');"
84+
85+ - name : Install Dependencies
86+ run : composer install --prefer-dist --no-progress --no-suggest
87+
88+ - name : Bakery Debug
89+ run : php bakery debug
90+
91+ - name : Migrate DB
92+ run : php bakery migrate
93+
94+ - name : Build Assets
95+ run : php bakery build-assets
96+
97+ - name : Execute tests
98+ run : app/vendor/bin/phpunit --coverage-clover=coverage.xml
99+
100+ - name : Upload coverage to Codecov
101+ if : github.event_name != 'schedule'
102+ uses : codecov/codecov-action@v1
103+ with :
104+ file : ./coverage.xml
105+ fail_ci_if_error : true
106+
107+ PHPUnit-SQLite :
108+
109+ strategy :
110+ fail-fast : false
111+ matrix :
112+ php_versions : ['7.1', '7.2', '7.3', '7.4']
113+
114+ runs-on : ubuntu-latest
115+ name : PHPUnit - PHP ${{ matrix.php_versions }} - SQLite
116+
117+ env :
118+ TEST_DB : default
119+ UF_MODE : debug
120+ DB_DRIVER : sqlite
121+ DB_NAME : database/database.sqlite
122+
123+ steps :
124+ - uses : actions/checkout@v2
125+
126+ - name : Setup PHP, with composer and extensions
127+ uses : shivammathur/setup-php@v2
128+ with :
129+ php-version : ${{ matrix.php_versions }}
130+ extensions : mbstring, dom, fileinfo, gd, memcached, redis, pdo_sqlite
131+ coverage : xdebug
132+ tools : pecl, composer:v1
133+
134+ - uses : actions/setup-node@v2
135+ with :
136+ node-version : 10
137+
138+ - name : Setup Redis-server
139+ uses :
supercharge/[email protected] 140+ with :
141+ redis-version : 6
142+
143+ - name : Setup Memcached
144+ uses : niden/actions-memcached@v7
145+
146+ - name : Copy .env
147+ run : php -r "copy('app/sprinkles.example.json', 'app/sprinkles.json');"
148+
149+ - name : Install Dependencies
150+ run : composer install --prefer-dist --no-progress --no-suggest
151+
152+ - name : Create SQLite Database
153+ run : |
154+ mkdir -p database
155+ touch database/database.sqlite
156+
157+ - name : Bakery Debug
158+ run : php bakery debug
159+
160+ - name : Migrate DB
161+ run : php bakery migrate
162+
163+ - name : Build Assets
164+ run : php bakery build-assets
165+
166+ - name : Execute tests
167+ run : app/vendor/bin/phpunit --coverage-clover=coverage.xml
168+
169+ - name : Upload coverage to Codecov
170+ if : github.event_name != 'schedule'
171+ uses : codecov/codecov-action@v1
172+ with :
173+ file : ./coverage.xml
174+ fail_ci_if_error : true
175+
176+ PHPUnit-Postgre :
177+
178+ strategy :
179+ fail-fast : false
180+ matrix :
181+ php_versions : ['7.1', '7.2', '7.3', '7.4']
182+
183+ runs-on : ubuntu-latest
184+ name : PHPUnit - PHP ${{ matrix.php_versions }} - PostgreSQL
185+
186+ env :
187+ TEST_DB : default
188+ UF_MODE : debug
189+ DB_DRIVER : pgsql
190+ DB_HOST : 127.0.0.1
191+ DB_USER : userfrosting
192+ DB_PASSWORD : password
193+ DB_NAME : userfrosting
194+ DB_PORT : 5432
195+
196+ steps :
197+ - uses : actions/checkout@v2
198+
199+ - name : Setup PHP, with composer and extensions
200+ uses : shivammathur/setup-php@v2
201+ with :
202+ php-version : ${{ matrix.php_versions }}
203+ extensions : mbstring, dom, fileinfo, gd, memcached, redis, pdo_sqlite, pdo_pgsql
204+ coverage : xdebug
205+ tools : pecl, composer:v1
206+
207+ - name : Setup PostgreSQL
208+ uses : harmon758/postgresql-action@v1
209+ with :
210+ postgresql db : ' userfrosting'
211+ postgresql user : ' userfrosting'
212+ postgresql password : ' password'
213+
214+ - uses : actions/setup-node@v2
215+ with :
216+ node-version : 10
217+
218+ - name : Setup Redis-server
219+ uses :
supercharge/[email protected] 220+ with :
221+ redis-version : 6
222+
223+ - name : Setup Memcached
224+ uses : niden/actions-memcached@v7
225+
226+ - name : Copy .env
227+ run : php -r "copy('app/sprinkles.example.json', 'app/sprinkles.json');"
228+
229+ - name : Install Dependencies
230+ run : composer install --prefer-dist --no-progress --no-suggest
231+
232+ - name : Bakery Debug
233+ run : php bakery debug
234+
235+ - name : Migrate DB
236+ run : php bakery migrate
237+
238+ - name : Build Assets
239+ run : php bakery build-assets
240+
241+ - name : Execute tests
242+ run : app/vendor/bin/phpunit --coverage-clover=coverage.xml
243+
244+ - name : Upload coverage to Codecov
245+ if : github.event_name != 'schedule'
246+ uses : codecov/codecov-action@v1
247+ with :
248+ file : ./coverage.xml
249+ fail_ci_if_error : true
250+
251+ PHPUnit-Windows :
252+
253+ strategy :
254+ fail-fast : false
255+ matrix :
256+ php_versions : ['7.1', '7.2', '7.3', '7.4']
257+
258+ runs-on : windows-latest
259+ name : PHPUnit - PHP ${{ matrix.php_versions }} - Windows
260+
261+ env :
262+ TEST_DB : default
263+ UF_MODE : debug
264+ DB_DRIVER : sqlite
265+ DB_NAME : database/database.sqlite
266+
267+ steps :
268+ - uses : actions/checkout@v2
269+
270+ - name : Setup PHP, with composer and extensions
271+ uses : shivammathur/setup-php@v2
272+ with :
273+ php-version : ${{ matrix.php_versions }}
274+ extensions : mbstring, dom, fileinfo, gd, pdo, sqlite, pdo_sqlite
275+ coverage : xdebug
276+ tools : pecl, composer:v1
277+
278+ - uses : actions/setup-node@v2
279+ with :
280+ node-version : 10
281+
282+ - name : Copy .env
283+ run : php -r "copy('app/sprinkles.example.json', 'app/sprinkles.json');"
284+
285+ - name : Install Dependencies
286+ run : composer install --prefer-dist --no-progress --no-suggest
287+
288+ - name : Create SQLite Database
289+ run : |
290+ mkdir -p database
291+ touch database/database.sqlite
292+
293+ - name : Bakery Debug
294+ run : php bakery debug
295+
296+ - name : Migrate DB
297+ run : php bakery migrate
298+
299+ - name : Build Assets
300+ run : php bakery build-assets
301+
302+ - name : Execute tests
303+ run : app/vendor/bin/phpunit --coverage-clover=coverage.xml
304+
305+ - name : Upload coverage to Codecov
306+ uses : codecov/codecov-action@v1
307+ with :
308+ file : ./coverage.xml
309+ fail_ci_if_error : true
310+
311+ Asset-Build :
312+
313+ strategy :
314+ fail-fast : false
315+ matrix :
316+ php_versions : ['7.4']
317+ node_versions : ['10', '12', '14']
318+ os : [ubuntu-latest, windows-latest]
319+
320+ runs-on : ${{ matrix.os }}
321+ name : Assets Build - PHP ${{ matrix.php_versions }} - Node ${{ matrix.node_versions }} - ${{ matrix.os }}
322+
323+ steps :
324+ - uses : actions/checkout@v2
325+
326+ - name : Setup PHP, with composer and extensions
327+ uses : shivammathur/setup-php@v2
328+ with :
329+ php-version : ${{ matrix.php_versions }}
330+ extensions : mbstring, dom, fileinfo, gd
331+ coverage : xdebug
332+ tools : pecl, composer:v1
333+
334+ - uses : actions/setup-node@v2
335+ with :
336+ node-version : ${{ matrix.node_versions }}
337+
338+ - name : Copy .env
339+ run : php -r "copy('app/sprinkles.example.json', 'app/sprinkles.json');"
340+
341+ - name : Install Dependencies
342+ run : composer install --prefer-dist --no-progress --no-suggest
343+
344+ - name : Execute build
345+ run : php bakery build-assets
0 commit comments