-
Notifications
You must be signed in to change notification settings - Fork 6
/
.gitlab-ci.yml
162 lines (151 loc) · 3.18 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
stages:
- check
- php
- build
- behave-test
- release
.go-cache:
variables:
GOPATH: $CI_PROJECT_DIR/.go
before_script:
- mkdir -p .go
- export PATH=$PATH:$GOPATH/bin
cache:
paths:
- .go/pkg/mod/
variables:
DOCKER_HOST: tcp://docker:2375
GIT_DEPTH: 10
GIT_SUBMODULE_STRATEGY: recursive
unit-test-lint:
stage: check
image: cimg/go:1.22
extends: .go-cache
script:
# Fake some files to avoid the compiler or "typecheck" linter complaining about a missing embedded file.
- touch internal/legacy/archives/php_linux_amd64 internal/legacy/archives/platform.phar internal/config/embedded-config.yaml
- export PATH=$PATH:$GOPATH/bin
- make lint test
coverage: '/total:\s+\(statements\)\s+\d+.\d+%/'
build-php-linux-x86:
cache:
- key:
files:
- Makefile
paths:
- internal/legacy/archives/php_linux_amd64
stage: php
image: docker:20.10-git
services:
- docker:20.10-dind
before_script:
- apk add -U make
- mkdir -p internal/legacy/archives
script:
- make php
artifacts:
paths:
- internal/legacy/archives/*
expire_in: 1 day
build-php-linux-arm:
rules:
- if: $CI_COMMIT_TAG
stage: php
image: docker:20.10-git
services:
- docker:20.10-dind
before_script:
- apk add -U make
- mkdir -p internal/legacy/archives
script:
- make php
artifacts:
paths:
- internal/legacy/archives/*
expire_in: 1 day
tags:
- arm-high-cpu
build-php-windows:
rules:
- if: $CI_COMMIT_TAG
stage: php
image: docker:20.10-git
before_script:
- apk add -U make wget
- mkdir -p internal/legacy/archives
script:
- make php GOOS=windows GOARCH=amd64
artifacts:
paths:
- internal/legacy/archives/*
expire_in: 1 day
build-php-macos-arm:
rules:
- if: $CI_COMMIT_TAG
stage: php
before_script:
- export PATH="/opt/homebrew/bin:$PATH"
script:
- make php
artifacts:
paths:
- internal/legacy/archives/*
expire_in: 1 day
tags:
- macos-arm
build-php-macos-x86:
rules:
- if: $CI_COMMIT_TAG
stage: php
script:
- make php
artifacts:
paths:
- internal/legacy/archives/*
expire_in: 1 day
tags:
- macos-x86
build:
stage: build
image: cimg/go:1.22
extends: .go-cache
script:
- make single
dependencies:
- build-php-linux-x86
artifacts:
paths:
- dist/
expire_in: 1 day
behave-test-linux:
stage: behave-test
dependencies:
- build
variables:
PATH_CLI: platform_linux_amd64_v1/platform
before_script:
- apt-get install -y python3 python3-pip
- pip3 install --no-cache-dir behave sh selenium requests
script:
- bash tests/test-behave.sh
image: pjcdawkins/platformsh-cli
release:
stage: release
rules:
- if: $CI_COMMIT_TAG
extends: .go-cache
script:
- export PATH="/opt/homebrew/bin:$PATH"
- brew install gon wget
- git remote set-url origin https://github.com/platformsh/cli
- make release
dependencies:
- unit-test-lint
- behave-test-linux
- build-php-linux-arm
- build-php-linux-x86
- build-php-macos-arm
- build-php-macos-x86
- build-php-windows
tags:
- macos-arm