-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
129 lines (114 loc) · 3.16 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
#ENV variables: https://docs.gitlab.com/ce/ci/variables/
image: karser/docker-compose-ci
stages:
- test
- deploy
variables:
npm_config_cache: '$CI_PROJECT_DIR/.cache/npm'
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- .cache/npm
- .composer/cache/files
before_script:
- docker -v && docker-compose -v
.run_test: &test_tpl
stage: test
variables: &test_vars
COMPOSE_PROJECT_NAME: 'tm_wp_plugin_test${CI_JOB_ID}'
COMPOSE_FILE: 'docker/docker-compose.yml'
GIT_BRANCH: ${CI_COMMIT_BRANCH}
before_script:
- echo ${COMPOSE_PROJECT_NAME}
- npm ci && npm run build && rm -rf node_modules/
- docker-compose up -d db
- docker-compose run --rm waiter
- docker-compose exec -T db bash -c 'mysql -u root -e "CREATE DATABASE IF NOT EXISTS wp_test"'
- docker-compose up -d
script:
- docker-compose exec -T wp bash -c '/project/docker/bin/install.sh'
- docker-compose exec -T wp bash -c 'cd /project; make info'
- docker-compose exec -T wp bash -c 'cd /project; make init'
- docker-compose exec -T wp bash -c 'cd /project; make test'
after_script:
- docker-compose down
artifacts:
expire_in: 1 week
when: always
paths:
- tests/_output/*.html
- build/*.zip
php74_wp53_wc45_test:
<<: *test_tpl
variables:
<<: *test_vars
PHP_VERSION: '7.4'
WORDPRESS_VERSION: '5.3'
WOOCOMMERCE_VERSION: '4.5.0'
ZIP_BUILD: 'true'
php74_wp58_wc61_test:
<<: *test_tpl
variables:
<<: *test_vars
PHP_VERSION: '7.4'
WORDPRESS_VERSION: '5.8.3'
WOOCOMMERCE_VERSION: '6.1.0'
php74_wp59_wc63_test:
<<: *test_tpl
variables:
<<: *test_vars
PHP_VERSION: '7.4'
WORDPRESS_VERSION: '5.9.2'
WOOCOMMERCE_VERSION: '6.3.1'
php81_wp61_wc72_test:
<<: *test_tpl
variables:
<<: *test_vars
PHP_VERSION: '8.1'
WORDPRESS_VERSION: '6.1.1'
WOOCOMMERCE_VERSION: '7.2.0'
php74_wp611_wc740_test:
<<: *test_tpl
variables:
<<: *test_vars
PHP_VERSION: '7.4'
WORDPRESS_VERSION: '6.1.1'
WOOCOMMERCE_VERSION: '7.4.0'
php74_wp631_wc811_test:
<<: *test_tpl
variables:
<<: *test_vars
PHP_VERSION: '7.4'
WORDPRESS_VERSION: '6.3.1'
WOOCOMMERCE_VERSION: '8.1.1'
php74_wp632_wc821_test:
<<: *test_tpl
variables:
<<: *test_vars
PHP_VERSION: '7.4'
WORDPRESS_VERSION: '6.3.2'
WOOCOMMERCE_VERSION: '8.2.1'
php81_wp631_wc811_test:
<<: *test_tpl
variables:
<<: *test_vars
PHP_VERSION: '8.1'
WORDPRESS_VERSION: '6.3.1'
WOOCOMMERCE_VERSION: '8.1.1'
php82_wp631_wc811_test:
<<: *test_tpl
variables:
<<: *test_vars
PHP_VERSION: '8.2'
WORDPRESS_VERSION: '6.3.1'
WOOCOMMERCE_VERSION: '8.1.1'
publish:
stage: deploy
only:
- tags
variables:
GIT_TAG: ${CI_COMMIT_TAG}
script:
- ls -alh build
- unzip -qq build/trackmage-woo-shipment-tracking.zip -d build
- bin/deploy.sh