forked from srl-labs/containerlab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
78 lines (71 loc) · 1.66 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
---
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "push"'
when: never # Prevent pipeline run for push event
- if: '$CI_PIPELINE_SOURCE == "external_pull_request_event"'
when: never # Prevent pipeline run for PRs from github mirror
- when: always # Run pipeline for all other cases
stages:
- code-tests
- build
- smoke-tests
- integration-tests
variables:
CGO_ENABLED: 0
go-tests:
stage: code-tests
tags:
- containerlab
script:
# create empty files to make clab happy
- sudo mkdir -p /etc/containerlab/templates/srl && sudo touch /etc/containerlab/templates/srl/srlconfig.tpl
- CGO_ENABLED=1 go test -cover -race ./...
build-containerlab:
stage: build
tags:
- containerlab
script:
- sudo go build -o /usr/bin/containerlab
smoke-tests:
stage: smoke-tests
parallel:
matrix:
- RUNTIME: [docker, containerd]
tags:
- containerlab
script:
- source ~/venvs/rf/bin/activate
- bash ./tests/rf-run.sh $RUNTIME ./tests/01-smoke
artifacts:
when: always
paths:
- "./tests/out/*.html"
srl-tests:
stage: integration-tests
parallel:
matrix:
- RUNTIME: [docker, containerd]
tags:
- containerlab
script:
- source ~/venvs/rf/bin/activate
- bash ./tests/rf-run.sh $RUNTIME ./tests/02-basic-srl
artifacts:
when: always
paths:
- "./tests/out/*.html"
ceos-tests:
stage: integration-tests
parallel:
matrix:
- RUNTIME: [docker, containerd]
tags:
- containerlab
script:
- source ~/venvs/rf/bin/activate
- bash ./tests/rf-run.sh $RUNTIME ./tests/02-basic-srl
artifacts:
when: always
paths:
- "./tests/out/*.html"