-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
146 lines (120 loc) · 3.16 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
image: nixos/nix:2.3.16
stages:
- build_test
- results
# Template for a job which compiles rodos, runs the test suite and
# collects both the test report as well as coverage information. This
# job does NOT fail when a test case has output different from the
# expected output. It DOES fail if any compilation fails.
.cov_tmpl:
stage: build_test
script:
- nix-build with-cmake.nix -A $TARGET
- mkdir $TARGET
- mv result/* $TARGET/
artifacts:
paths:
- $TARGET
when: always
expire_in: 1 week
# Template for a job which compiles rodos only, failing if any
# compilation fails.
.compile_tmpl:
stage: build_test
script:
- nix-build with-cmake.nix -A $TARGET
# Jobs for the actual ports, using one of the templates from above.
linux-x86:
extends: .cov_tmpl
variables:
TARGET: linux-x86
linux-makecontext:
extends: .cov_tmpl
variables:
TARGET: linux-makecontext
posix:
extends: .cov_tmpl
variables:
TARGET: posix
sf2:
extends: .compile_tmpl
variables:
TARGET: sf2
raspberrypi3:
extends: .compile_tmpl
variables:
TARGET: raspberrypi3
discovery:
extends: .compile_tmpl
variables:
TARGET: discovery
skith:
extends: .compile_tmpl
variables:
TARGET: skith
nucleo_l496zg:
extends: .compile_tmpl
before_script:
- nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs
- nix-channel --update
variables:
TARGET: nucleo_l496zg
va41620:
extends: .compile_tmpl
before_script:
- nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs
- nix-channel --update
variables:
TARGET: va41620
# Job collecting coverage results from coverage generating jobs from
# the build_test stage. Runs even when a compile only job fails.
# Merges the collected coverage information into a combined report.
coverage:
stage: results
needs:
- job: linux-x86
artifacts: true
- job: linux-makecontext
artifacts: true
- job: posix
artifacts: true
script:
- nix-env -i lcov binutils
- lcov -a $(echo */coverage.info | sed -e 's@ @ -a @g') --output-file coverage.info
- genhtml --demangle-cpp -o coverage coverage.info
artifacts:
paths:
- coverage.info
- coverage
expire_in: 1 week
# Job inspecting the test reports of jobs which have run the test
# suite. Fails if any of these test reports shows an error. Depends
# ("needs") only on jobs generating a test report.
#test-report:
# stage: results
# needs:
# - job: linux-x86
# artifacts: true
# - job: linux-makecontext
# artifacts: true
# - job: posix
# artifacts: true
# variables:
# GIT_STRATEGY: none
# script:
# - failures=None
# - for r in */test-report.txt; do if [ ! -s $r ]; then echo "$r error free!"; else echo "$r contains ERRORS!"; failures=yes; fi; done
# - if [ $failures != None ]; then exit 1; fi
# Job uploading merged coverage report to codecov.io
#codecov.io:
# stage: deploy
# variables:
# GIT_STRATEGY: none
# script:
# - nix-env -i curl
# - nix-env -i bash
# - curl https://codecov.io/bash -o codecov
# - bash codecov -f coverage.info
# needs:
# - job: coverage
# artifacts: true