Repository navigation
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
64 lines (57 loc) · 1.67 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
64 lines (57 loc) · 1.67 KB
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
stages:
- test
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/cimg/go:1.27
workflow:
auto_cancel:
on_new_commit: interruptible
.go-setup:
interruptible: true
cache:
key:
files:
- go.sum
paths:
- ${GOMODCACHE}/
variables:
GOMODCACHE: $CI_PROJECT_DIR/.gomodcache
before_script:
- mkdir -p ${GOMODCACHE}
# Create fake embedded files for lint and test purposes:
- mkdir -p internal/legacy/archives
- touch internal/legacy/archives/platform.phar
- touch internal/legacy/archives/php_windows_amd64
- touch internal/legacy/archives/php_linux_amd64
- touch internal/legacy/archives/php_linux_arm64
- touch internal/legacy/archives/php_darwin_amd64
- touch internal/legacy/archives/php_darwin_arm64
- touch internal/config/embedded-config.yaml
test:
stage: test
extends: .go-setup
script:
- go test -v -race -cover ./...
coverage: '/total:\s+\(statements\)\s+\d+.\d+%/'
golangci-lint:
stage: test
extends: .go-setup
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/golangci/golangci-lint:v2.14
script: golangci-lint run --timeout 0 --verbose
legacy-php:
stage: test
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/php:8.5-cli
interruptible: true
cache:
key:
files:
- legacy/composer.lock
paths:
- ${COMPOSER_HOME}/
variables:
COMPOSER_HOME: $CI_PROJECT_DIR/.composer
before_script:
- apt-get update && apt-get install -y zip unzip git
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
- php composer-setup.php --install-dir=/usr/local/bin --filename=composer
- make composer-dev
script:
- make lint-php test-php