-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
54 lines (46 loc) · 1.04 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
image: ubuntu-latest
services:
- name: mysql:5.7
alias: mysql
variables:
MYSQL_HOST: 127.0.0.1
MYSQL_DATABASE: user_auth
MYSQL_USER: root
MYSQL_PASSWORD: root
MYSQL_ROOT_PASSWORD: root
cache:
paths:
- vendor/
- ~/.composer/cache
before_script:
- apt-get update && apt-get install -y unzip git default-mysql-client
- docker-php-ext-install pdo_mysql
- php --version
- |
echo "Waiting for MySQL to be ready..."
until 127.0.0.1 -h $MYSQL_HOST -u $MYSQL_USER -p$MYSQL_PASSWORD -e "SELECT 1"; do
echo "MySQL is not ready yet, waiting...";
sleep 5;
done
stages:
- install
- test
- build
install_dependencies:
stage: install
script:
- curl -sS https://getcomposer.org/installer | php
- php composer.phar install --prefer-dist --no-progress --ignore-platform-reqs
artifacts:
paths:
- vendor/
run_tests:
stage: test
script:
- php vendor/bin/phpunit --configuration phpunit.xml.dist
only:
- main
build:
stage: build
script:
- echo "Building project..."