-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path.gitlab-ci.yml
143 lines (131 loc) · 4.92 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
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
139
140
141
142
143
################################################################################
#
# This file is part of SplashSync Project.
#
# Copyright (C) Splash Sync <www.splashsync.com>
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
# @author Bernard Paquier <[email protected]>
#
################################################################################
################################################################
# Include Pipeline Templates
include:
- remote: 'https://raw.githubusercontent.com/BadPixxel/Php-Sdk/main/gitlab/pages.yaml'
################################################################
# Set any variables we need
variables:
# Configure mysql environment variables (https://hub.docker.com/r/_/mysql/)
MYSQL_DATABASE: wordpress
MYSQL_ROOT_PASSWORD: admin
DOCKER_DRIVER: overlay2
COMPOSER_MEMORY_LIMIT: -1
BUILD_DIR: /var/www/html
PLUGIN_DIR: /var/www/html/wp-content/plugins/splash-connector
################################################################
# Defined Pipeline Stages
stages:
- Builds
- Tests
# - Builds
################################################################
# Functional Tests
################################################################
.functionnal: &functionnal
stage: Tests
tags: ['Dedicated']
retry: 2
services:
- name: mysql:5.7
################################################################
# Before Script
before_script:
- sh "ci/install-core.sh"
- sh "ci/install-plugins.sh"
- sh "$PLUGIN_DIR/ci/configure.sh"
################################################################
# Test Script
script:
- cd "$PLUGIN_DIR"
################################################################
# Run GrumPhp Main Test Sequence
- php vendor/bin/grumphp run --testsuite=travis
- php vendor/bin/grumphp run --testsuite=csfixer
- php vendor/bin/grumphp run --testsuite=phpstan
################################################################
# Execute Phpunit Local test Sequence
- wp plugin delete wp-multilang --allow-root
- php vendor/bin/phpunit -c grumphp/phpunit.xml.dist --testsuite=Local
# Execute Complete PhpUnit Tests
- php vendor/bin/phpunit -c grumphp/phpunit.xml.dist
Wp-6.7-Php-8.3:
image: wordpress:6.7-php8.3
variables:
WORDPRESS_VERSION: "6.7"
<<: *functionnal
allow_failure: true
Wp-6.6-Php-8.2:
image: wordpress:6.6-php8.2
variables:
WORDPRESS_VERSION: "6.6"
<<: *functionnal
allow_failure: true
Wp-6.4-Php-8.2:
image: wordpress:6.4-php8.2
variables:
WORDPRESS_VERSION: "6.4"
WOOCOMMERCE_VERSION: "8.0.4"
<<: *functionnal
Wp-6.3-Php-8.1:
image: wordpress:6.3-php8.1
variables:
WORDPRESS_VERSION: "6.3"
WOOCOMMERCE_VERSION: "8.0.4"
<<: *functionnal
Wp-6.2-Php-8.0:
image: wordpress:6.2-php8.0
variables:
WORDPRESS_VERSION: "6.2"
WOOCOMMERCE_VERSION: "8.0.4"
<<: *functionnal
Wp-6.1-Php-7.4:
image: wordpress:6.1-php7.4
variables:
WORDPRESS_VERSION: "6.1"
WOOCOMMERCE_VERSION: "7.9.0"
<<: *functionnal
#################################################################
## Build Module
#################################################################
module:
image: registry.gitlab.com/badpixxel-projects/php-sdk:jekyll
stage: Builds
tags: ['Dedicated']
retry: 2
variables:
PLUGIN_VERSION: "2.0.7"
WP_ORG_RELEASE_REF: "2.0.7"
################################################################################
# Run Test Script
script:
# Run Composer to Build deps
- curl -s https://raw.githubusercontent.com/BadPixxel/Php-Sdk/main/ci/composer.sh | bash
# Build Module Zip
- php vendor/bin/grumphp run --tasks=build-module
# Install No Dev Libs
- composer install --no-dev
# Vendors files has to be committed to be used
- git config --global user.email "[email protected]"
- git config --global user.name "Splash Sync (GitLab CI)"
- git add -f vendor && git commit -m "Add vendor files"
# Deploy Module on Wp Plugin Repository
- curl -s https://git-cdn.e15r.co/open-source/wp-org-plugin-deploy/raw/master/scripts/deploy.sh | bash
artifacts:
paths:
- build