forked from hifis-net/ansible-role-gitlab-runner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
67 lines (58 loc) · 1.47 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
# SPDX-FileCopyrightText: 2020 Helmholtz Centre for Environmental Research (UFZ)
# SPDX-FileCopyrightText: 2020 Helmholtz-Zentrum Dresden-Rossendorf (HZDR)
#
# SPDX-License-Identifier: Apache-2.0
---
stages:
- lint
- test
variables:
# tell Python-based tools to force color output
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
.before_script_template: &before_script
# Ansible refuses to read from a world-writeable folder
- chmod 0750 $CI_PROJECT_DIR
- pip install -U pip
- pip install --ignore-installed poetry
- poetry install
include:
- project: hifis/templates/gitlab-ci
file: /templates/reuse-compliance.yml
validate:
stage: lint
image: python:3.8
before_script:
- *before_script
script:
- poetry run molecule lint
test:
extends: .moleculetest
parallel:
matrix:
- MOLECULE_DISTRO:
- ubuntu2004
- debian10
.moleculetest:
stage: test
image: docker:latest
variables:
POETRY_VIRTUALENVS_PATH: $CI_PROJECT_DIR/.cache/venv
POETRY_CACHE_DIR: $CI_PROJECT_DIR/.cache/poetry
PIP_CACHE_DIR: $CI_PROJECT_DIR/.cache/pip
services:
- docker:dind
before_script:
- apk update && apk add --no-cache
python3-dev py3-pip gcc git curl build-base
autoconf automake py3-cryptography linux-headers
musl-dev libffi-dev openssl-dev openssh cargo
- docker info
- python3 --version
- *before_script
script:
- poetry run molecule test
cache:
paths:
- .cache
...