-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
54 lines (49 loc) · 1.72 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
54 lines (49 loc) · 1.72 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
################################################################################
# Basic build + validate GitLab CI for the Varbase recipe release.
#
# Mirrors the build / validate stages of the Varbase project template, reduced
# to the minimum a recipe needs: validate composer.json (build) and lint every
# YAML file - recipe.yml + config (validate). No dependency install / browser
# tests here (kept basic).
################################################################################
stages:
- build
- validate
variables:
# Drupal 11.4.0 released 2026-07-01; pinned templates ref $CORE_STABLE is still 11.3.
DRUPAL_CORE: "11.4.0"
IGNORE_PROJECT_DRUPAL_CORE_VERSION: "1"
COMPOSER_ALLOW_SUPERUSER: "1"
COMPOSER_MEMORY_LIMIT: "-1"
# Run for merge requests and branch pushes.
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH
- if: $CI_COMMIT_TAG
# = build = validate the recipe's composer.json (schema + metadata, offline).
build:composer-validate:
stage: build
image: composer:2
script:
- composer --version
- composer validate --no-check-all --no-check-publish
# = validate = lint every YAML file (recipe.yml + config/*) for syntax errors.
validate:yaml-lint:
stage: validate
image: python:3.12-slim
script:
- python --version
- pip install --quiet pyyaml
- |
python - <<'PY'
import glob, sys, yaml
bad = 0
for f in sorted(glob.glob('**/*.yml', recursive=True)):
try:
list(yaml.safe_load_all(open(f, encoding='utf-8')))
except Exception as e:
print('YAML ERROR:', f, '->', e); bad += 1
print('Checked YAML files; errors:', bad)
sys.exit(1 if bad else 0)
PY