-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
109 lines (99 loc) · 2.11 KB
/
.gitlab-ci.yml
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
stages:
- build
- test_js
- test_php
.setup_php: &setup_php
image: php:8.3.12-alpine
services:
- mariadb:11.4.3
variables:
# from .env.testing, needs to be here as .env isn't copied yet
MYSQL_DATABASE: ricochetlevels_test
MYSQL_USER: ricochetlevels_test
MYSQL_PASSWORD: '123'
MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
before_script:
- apk update && apk upgrade
- apk add --no-cache git
- docker-php-ext-install pdo_mysql
.setup_node: &setup_node
image: node:20
npm:
stage: build
<<: *setup_node
cache:
key: nodejs
paths:
- node_modules/
artifacts:
paths:
- node_modules/
script:
- npm ci
composer:
stage: build
<<: *setup_php
cache:
key: php
paths:
- vendor/
artifacts:
paths:
- vendor/
- .env
script:
- curl https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- composer install --no-progress
- cp .env.testing .env
- php artisan key:generate
- php artisan migrate
lint:
stage: test_js
<<: *setup_node
dependencies:
- npm
script:
- npm run flow
- npm run lint
- npm test
- npm run prettier -- -l
webpack:
stage: test_js
<<: *setup_node
dependencies:
- npm
artifacts:
paths:
- public/build/
- public/mix-manifest.json
script:
- npm run production
phpunit:
stage: test_php
<<: *setup_php
script:
- php ./vendor/bin/phpunit
dependencies:
- composer
- webpack
needs:
- composer
- webpack
pint:
stage: test_php
<<: *setup_php
script:
- php ./vendor/bin/pint --test
dependencies:
- composer
needs:
- composer
phpstan:
stage: test_php
<<: *setup_php
script:
- php ./vendor/bin/phpstan analyse --memory-limit=256M
dependencies:
- composer
needs:
- composer