-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
82 lines (76 loc) · 1.95 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
# **************************************************************************** #
# Advent of Code 2021 #
# **************************************************************************** #
# 2021 template
.2021-template:
variables:
AOC_YEAR: 2021
# Prepare docker for 2021
docker ~ aoc-2021:
extends:
- .2021-template
- .prepare-docker-template
# 2021 Rust build (debug + release)
build ~ aoc-2021:
stage: build
extends:
- .2021-template
- .run-current-year-template
needs:
- docker ~ aoc-2021
script:
- cargo build --workspace -j2
- cargo build --release --workspace --verbose -j2
# 2021 Rust test (debug)
test ~ aoc-2021:
stage: test
extends:
- .2021-template
- .run-current-year-template
needs:
- build ~ aoc-2021
script:
- >-
cargo test --workspace --no-fail-fast --verbose -j2 --
-Z unstable-options --report-time
after_script:
- >-
cargo test --workspace --no-fail-fast --verbose -j2 --
-Z unstable-options --format json --report-time
| cargo2junit > JUnitReports.xml
artifacts:
reports:
junit: 2021/JUnitReports.xml
when: always
expire_in: 1 week
# 2021 Rust fmt check
format ~ aoc-2021:
stage: test
extends:
- .2021-template
- .run-current-year-template
needs:
- docker ~ aoc-2021
- job: build ~ aoc-2021
optional: true
script:
- cargo fmt --verbose -- --check
allow_failure: true
# 2021 Rust benchmark (release)
bench ~ aoc-2021:
stage: benchmark
extends:
- .2021-template
- .run-current-year-template
needs:
- test ~ aoc-2021
script:
- >-
cargo bench --workspace --no-fail-fast --verbose -j2 --
--warm-up-time 1 --measurement-time 2 --sample-size 10
- cd ${CI_PROJECT_DIR}
- mkdir -p benchmarks_${AOC_YEAR}
- mv ${AOC_YEAR}/target/criterion/* benchmarks_${AOC_YEAR}
artifacts:
paths:
- benchmarks_${AOC_YEAR}