-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
107 lines (97 loc) · 2.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
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
image: $CI_REGISTRY_IMAGE/build:ci-image
variables:
GIT_SUBMODULE_STRATEGY: recursive
STAG_AVR_DEVICE: /dev/arduino_uno_5543131303835151E052
STAG_AVR_MCU: atmega328p
STAG_AVR_PROGRAMMER: arduino
PROD_AVR_DEVICE: /dev/arduino_uno_7403130313735110C0C0
PROD_AVR_MCU: atmega328p
PROD_AVR_PROGRAMMER: arduino
linux:
script:
- rm -rf build ; mkdir build && cd build
- cmake -DCMAKE_BUILD_TYPE=Coverage -G Ninja ..
- cmake --build .
- cmake --build . --target test
- valgrind --leak-check=full --track-origins=yes --error-exitcode=1
tests/tests
- cmake --build . --target gcovr_to_html
- cmake --build . --target dox
artifacts:
paths:
- build/html
- build/tests/coverage*.html
coverage: '/branches: (\d+\.\d\%) /'
scan-build:
script:
- rm -rf build ; mkdir build && cd build
- scan-build-6.0 cmake -DCMAKE_BUILD_TYPE=Debug -G Ninja ..
- scan-build-6.0 -v -v -o scan-build-report cmake --build .
artifacts:
paths:
- build/scan-build-report
.build_template: &build_template
script:
- rm -rf build ; mkdir build && cd build
- cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/avr/generic-gcc-avr.cmake
-DBUILD_DOCUMENTATION=OFF
-DTARGET_CONFIGURATION="$AVR_TARGET_CONFIGURATION"
-DAVR_MCU="$AVR_MCU"
-G Ninja ..
- cmake --build .
artifacts:
paths:
- build/target/sensors-$AVR_MCU.hex
build:arduino:
<<: *build_template
variables:
AVR_TARGET_CONFIGURATION: arduino
AVR_MCU: atmega328p
build:atdemo:
<<: *build_template
variables:
AVR_TARGET_CONFIGURATION: atdemo
AVR_MCU: atmega32
.deploy_template: &deploy_template
stage: deploy
dependencies:
- build:arduino
- build:atdemo
script:
- /usr/local/bin/usbreset.sh $AVR_DEVICE
- avrdude -v -c $AVR_PROGRAMMER -P $AVR_DEVICE -p $AVR_MCU
-U flash:w:build/target/sensors-$AVR_MCU.hex
tags:
- arduino
when: manual
deploy:staging:
<<: *deploy_template
variables:
AVR_DEVICE: $STAG_AVR_DEVICE
AVR_MCU: $STAG_AVR_MCU
AVR_PROGRAMMER: $STAG_AVR_PROGRAMMER
GIT_STRATEGY: none
environment:
name: $CI_PROJECT_NAME - Staging
deploy:production:
<<: *deploy_template
variables:
AVR_DEVICE: $PROD_AVR_DEVICE
AVR_MCU: $PROD_AVR_MCU
AVR_PROGRAMMER: $PROD_AVR_PROGRAMMER
GIT_STRATEGY: none
environment:
name: $CI_PROJECT_NAME - Production
tools:
image: python:3.6
variables:
GIT_SUBMODULE_STRATEGY: none
before_script:
- pip --cache-dir=tools/.pip install tox
script:
- cd tools && tox -e py36
cache:
paths:
- tools/.pip
- tools/.tox
coverage: '/\s+(?:\d+\s+){4}(\d+\%)/'