Skip to content

Commit d83070c

Browse files
committed
Added 2024 CI pipelines
1 parent 5f4c018 commit d83070c

File tree

6 files changed

+98
-23
lines changed

6 files changed

+98
-23
lines changed

.gitlab-ci.yml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
stages:
2-
- Prepare
3-
- Build
4-
- Test
5-
- Benchmark
6-
- Deploy
2+
- prepare
3+
- build
4+
- test
5+
- benchmark
6+
- deploy
77

88
# **************************************************************************** #
99
# Templates #
@@ -15,7 +15,7 @@ stages:
1515
- linux
1616
- docker
1717
variables:
18-
AOC_CURRENT_YEAR: 2023
18+
AOC_CURRENT_YEAR: 2024
1919
DOCKER_CURRENT_IMAGE: ${CI_REGISTRY_IMAGE}:aoc-${AOC_YEAR}-${CI_COMMIT_SHA}
2020
DOCKER_LATEST_IMAGE: ${CI_REGISTRY_IMAGE}:aoc-${AOC_YEAR}-latest
2121
image: ${DOCKER_CURRENT_IMAGE}
@@ -31,12 +31,12 @@ stages:
3131

3232
# Prepare docker
3333
.prepare-docker-template:
34-
stage: Prepare
34+
stage: prepare
3535
extends:
3636
.run-current-year-template
37-
image: docker:20.10.18-git
37+
image: docker:27.3.1
3838
services:
39-
- docker:20.10.18-dind
39+
- docker:27.3.1-dind
4040
before_script:
4141
- env
4242
- pwd
@@ -55,21 +55,22 @@ stages:
5555
- docker push ${DOCKER_LATEST_IMAGE}
5656

5757
# **************************************************************************** #
58-
# Advent of Code 2021-2023 #
58+
# Advent of Code 2021-2024 #
5959
# **************************************************************************** #
6060

6161
include:
6262
- local: '2021/.gitlab-ci.yml'
6363
- local: '2022/.gitlab-ci.yml'
6464
- local: '2023/.gitlab-ci.yml'
65+
- local: '2024/.gitlab-ci.yml'
6566

6667
# **************************************************************************** #
6768
# Pages deployment #
6869
# **************************************************************************** #
6970

7071
# Create pages with benchmark results
7172
pages:
72-
stage: Deploy
73+
stage: deploy
7374
tags:
7475
- linux
7576
rules:
@@ -81,6 +82,8 @@ pages:
8182
optional: true
8283
- job: bench ~ aoc-2023
8384
optional: true
85+
- job: bench ~ aoc-2024
86+
optional: true
8487
script:
8588
- mkdir -p public
8689
- if [ -d "benchmarks_2021" ]; then
@@ -92,6 +95,9 @@ pages:
9295
- if [ -d "benchmarks_2023" ]; then
9396
- mv benchmarks_2023 public/2023
9497
- fi
98+
- if [ -d "benchmarks_2024" ]; then
99+
- mv benchmarks_2024 public/2024
100+
- fi
95101
artifacts:
96102
paths:
97103
- public

2021/.gitlab-ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ docker ~ aoc-2021:
1515

1616
# 2021 Rust build (debug + release)
1717
build ~ aoc-2021:
18-
stage: Build
18+
stage: build
1919
extends:
2020
- .2021-template
2121
- .run-current-year-template
@@ -27,7 +27,7 @@ build ~ aoc-2021:
2727

2828
# 2021 Rust test (debug)
2929
test ~ aoc-2021:
30-
stage: Test
30+
stage: test
3131
extends:
3232
- .2021-template
3333
- .run-current-year-template
@@ -50,7 +50,7 @@ test ~ aoc-2021:
5050

5151
# 2021 Rust fmt check
5252
format ~ aoc-2021:
53-
stage: Test
53+
stage: test
5454
extends:
5555
- .2021-template
5656
- .run-current-year-template
@@ -64,7 +64,7 @@ format ~ aoc-2021:
6464

6565
# 2021 Rust benchmark (release)
6666
bench ~ aoc-2021:
67-
stage: Benchmark
67+
stage: benchmark
6868
extends:
6969
- .2021-template
7070
- .run-current-year-template

2022/.gitlab-ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ docker ~ aoc-2022:
1515

1616
# 2022 TypeScript build
1717
build ~ aoc-2022:
18-
stage: Build
18+
stage: build
1919
extends:
2020
- .2022-template
2121
- .run-current-year-template
@@ -26,7 +26,7 @@ build ~ aoc-2022:
2626

2727
# 2022 TypeScript test
2828
test ~ aoc-2022:
29-
stage: Test
29+
stage: test
3030
extends:
3131
- .2022-template
3232
- .run-current-year-template
@@ -44,7 +44,7 @@ test ~ aoc-2022:
4444

4545
# 2022 TypeScript fmt check
4646
format ~ aoc-2022:
47-
stage: Test
47+
stage: test
4848
extends:
4949
- .2022-template
5050
- .run-current-year-template
@@ -58,7 +58,7 @@ format ~ aoc-2022:
5858

5959
# 2022 TypeScript benchmark (release)
6060
bench ~ aoc-2022:
61-
stage: Benchmark
61+
stage: benchmark
6262
extends:
6363
- .2022-template
6464
- .run-current-year-template

2023/.gitlab-ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ docker ~ aoc-2023:
1515

1616
# 2023 Kotlin build
1717
build ~ aoc-2023:
18-
stage: Build
18+
stage: build
1919
extends:
2020
- .2023-template
2121
- .run-current-year-template
@@ -26,7 +26,7 @@ build ~ aoc-2023:
2626

2727
# 2023 Kotlin test
2828
test ~ aoc-2023:
29-
stage: Test
29+
stage: test
3030
extends:
3131
- .2023-template
3232
- .run-current-year-template
@@ -42,7 +42,7 @@ test ~ aoc-2023:
4242

4343
# 2023 Kotlin fmt check
4444
format ~ aoc-2023:
45-
stage: Test
45+
stage: test
4646
extends:
4747
- .2023-template
4848
- .run-current-year-template
@@ -56,7 +56,7 @@ format ~ aoc-2023:
5656

5757
# 2023 Kotlin benchmark (release)
5858
bench ~ aoc-2023:
59-
stage: Benchmark
59+
stage: benchmark
6060
extends:
6161
- .2023-template
6262
- .run-current-year-template

2024/.gitlab-ci.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# **************************************************************************** #
2+
# Advent of Code 2024 #
3+
# **************************************************************************** #
4+
5+
# 2024 template
6+
.2024-template:
7+
variables:
8+
AOC_YEAR: 2024
9+
10+
# Prepare docker for 2024
11+
docker ~ aoc-2024:
12+
extends:
13+
- .2024-template
14+
- .prepare-docker-template
15+
16+
# 2024 Zig build
17+
build ~ aoc-2024:
18+
stage: build
19+
extends:
20+
- .2024-template
21+
- .run-current-year-template
22+
needs:
23+
- docker ~ aoc-2024
24+
script:
25+
- zig build -Doptimize=ReleaseSafe -j2
26+
27+
# 2024 Zig test
28+
test ~ aoc-2024:
29+
stage: test
30+
extends:
31+
- .2024-template
32+
- .run-current-year-template
33+
needs:
34+
- build ~ aoc-2024
35+
script:
36+
- zig build -Doptimize=Debug -j2 test
37+
artifacts:
38+
reports:
39+
junit: 2024/**/*ExampleTest.xml
40+
when: always
41+
expire_in: 1 week
42+
43+
# 2024 Zig fmt check
44+
format ~ aoc-2024:
45+
stage: test
46+
extends:
47+
- .2024-template
48+
- .run-current-year-template
49+
needs:
50+
- docker ~ aoc-2024
51+
- job: build ~ aoc-2024
52+
optional: true
53+
script:
54+
- zig fmt --check ./**/*.zig
55+
allow_failure: true
56+
57+
# 2024 Zig benchmark (release)
58+
bench ~ aoc-2024:
59+
stage: benchmark
60+
extends:
61+
- .2024-template
62+
- .run-current-year-template
63+
needs:
64+
- test ~ aoc-2024
65+
script:
66+
- zig build -Doptimize=ReleaseFast -j2 benchmark

2024/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# syntax=docker/dockerfile:1
2+
FROM alpine:3.21.0
3+
RUN apk add --no-cache bash zig

0 commit comments

Comments
 (0)