Skip to content

Commit cd70d9f

Browse files
authored
ci: add tests (#7)
1 parent b8f3fa4 commit cd70d9f

77 files changed

Lines changed: 168 additions & 26 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/tests.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: Advent of Code Tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
rust_tests:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
project:
11+
- 2015
12+
- 2018
13+
- 2019/aoc_rust
14+
- 2020/01
15+
- 2021/_1
16+
- 2021/_2
17+
- 2021/_3
18+
- 2021/_4
19+
- 2021/_5
20+
- 2021/_6
21+
- 2021/_7
22+
- 2022
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: Install Rust Stable
26+
uses: dtolnay/rust-toolchain@stable
27+
if: ${{ matrix.project != '2021/_4' }}
28+
- name: Install Rust Nightly for 2021/_4
29+
uses: dtolnay/rust-toolchain@nightly
30+
if: ${{ matrix.project == '2021/_4' }}
31+
- name: Set up cargo-nextest
32+
uses: taiki-e/install-action@nextest
33+
- name: Build 2015 binary
34+
if: ${{ matrix.project == '2015' }}
35+
run: cargo build --release
36+
working-directory: ${{ matrix.project }}
37+
- name: Run Rust tests in 2015 with cargo-nextest
38+
if: ${{ matrix.project == '2015' }}
39+
run: cargo nextest run
40+
working-directory: ${{ matrix.project }}
41+
- name: Run Rust tests in ${{ matrix.project }}
42+
if: ${{ matrix.project != '2015' }}
43+
run: cargo test
44+
working-directory: ${{ matrix.project }}
45+
46+
go_tests:
47+
runs-on: ubuntu-latest
48+
strategy:
49+
matrix:
50+
project:
51+
- 2017
52+
- 2019/go
53+
- 2020/02
54+
- 2024/golang
55+
steps:
56+
- uses: actions/checkout@v4
57+
- name: Set up Go
58+
uses: actions/setup-go@v5
59+
with:
60+
go-version: '^1.18'
61+
- name: Run Go tests in 2017
62+
if: ${{ matrix.project == '2017' }}
63+
run: go test ./...
64+
working-directory: 2017
65+
- name: Run Go tests in 2019/go
66+
if: ${{ matrix.project == '2019/go' }}
67+
run: go test ./cmd/...
68+
working-directory: 2019/go
69+
- name: Run Go tests in 2020/02
70+
if: ${{ matrix.project == '2020/02' }}
71+
run: go test ./...
72+
working-directory: 2020/02
73+
- name: Run Go tests in 2024/golang
74+
if: ${{ matrix.project == '2024/golang' }}
75+
run: go test ./cmd/...
76+
working-directory: 2024/golang
77+
78+
csharp_tests:
79+
runs-on: ubuntu-latest
80+
strategy:
81+
matrix:
82+
project:
83+
- 2021/cs/1
84+
- 2021/cs/2
85+
steps:
86+
- uses: actions/checkout@v4
87+
- name: Set up .NET
88+
uses: actions/setup-dotnet@v4
89+
with:
90+
dotnet-version: '6.0.x'
91+
- name: Restore dependencies for ${{ matrix.project }}
92+
run: dotnet restore
93+
working-directory: ${{ matrix.project }}
94+
- name: Run C# tests in ${{ matrix.project }}
95+
run: dotnet test
96+
working-directory: ${{ matrix.project }}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)