-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
176 lines (158 loc) · 3.36 KB
/
.gitlab-ci.yml
File metadata and controls
176 lines (158 loc) · 3.36 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
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
stages:
- test
- build
- safety
- deploy
variables:
CARGO_HOME: $CI_PROJECT_DIR/.cargo
RUST_BACKTRACE: "1"
cache:
paths:
- .cargo/
- target/
before_script:
- rustc --version
- cargo --version
test:unit:
stage: test
image: rust:latest
script:
- cargo test --all-features --workspace --verbose
artifacts:
reports:
junit: target/junit.xml
test:integration:
stage: test
image: rust:latest
script:
- cargo build --release
- ./target/release/arclang check examples/aerospace/flight_control_system.arc
- ./target/release/arclang check examples/automotive/adaptive_cruise_control.arc
- ./target/release/arclang check examples/defense/mission_computer.arc
lint:fmt:
stage: test
image: rust:latest
script:
- rustup component add rustfmt
- cargo fmt --all -- --check
lint:clippy:
stage: test
image: rust:latest
script:
- rustup component add clippy
- cargo clippy --all-targets --all-features -- -D warnings
coverage:
stage: test
image: rust:latest
script:
- cargo install cargo-tarpaulin
- cargo tarpaulin --all-features --workspace --timeout 300 --out Xml
coverage: '/\d+\.\d+% coverage/'
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: cobertura.xml
build:debug:
stage: build
image: rust:latest
script:
- cargo build --workspace --verbose
artifacts:
paths:
- target/debug/arclang
build:release:
stage: build
image: rust:latest
script:
- cargo build --release --workspace
artifacts:
paths:
- target/release/arclang
expire_in: 1 week
safety:do178c:
stage: safety
image: rust:latest
dependencies:
- build:release
script:
- ./target/release/arclang safety examples/aerospace/flight_control_system.arc --standard DO178C --report
artifacts:
paths:
- "*_safety_report.pdf"
expire_in: 1 month
safety:iso26262:
stage: safety
image: rust:latest
dependencies:
- build:release
script:
- ./target/release/arclang safety examples/automotive/adaptive_cruise_control.arc --standard ISO26262 --fmea --fta --report
artifacts:
paths:
- "*_safety_report.pdf"
- "*_fmea.csv"
- "*_fta.dot"
expire_in: 1 month
safety:iec61508:
stage: safety
image: rust:latest
dependencies:
- build:release
script:
- ./target/release/arclang safety examples/industrial/plc_control.arc --standard IEC61508 --report
artifacts:
paths:
- "*_safety_report.pdf"
expire_in: 1 month
allow_failure: true
benchmark:
stage: test
image: rust:latest
script:
- cargo bench --workspace
artifacts:
paths:
- target/criterion/
expire_in: 1 week
security:audit:
stage: test
image: rust:latest
script:
- cargo install cargo-audit
- cargo audit
allow_failure: true
docs:build:
stage: build
image: rust:latest
script:
- cargo doc --all-features --no-deps --workspace
artifacts:
paths:
- target/doc/
expire_in: 1 week
docs:deploy:
stage: deploy
image: rust:latest
dependencies:
- docs:build
script:
- echo "Deploying documentation..."
artifacts:
paths:
- target/doc/
only:
- main
- tags
pages:
stage: deploy
dependencies:
- docs:build
script:
- mkdir -p public
- cp -r target/doc/* public/
artifacts:
paths:
- public
only:
- main