Skip to content

Commit 096b068

Browse files
committed
fix: ensure CI doesn't fetch aoc
1 parent 6cd55d7 commit 096b068

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/main/kotlin/dev/mtib/aoc/day/AocDay.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@ open class AocDay(
187187
if (releaseTime.isAfter(ZonedDateTime.now())) {
188188
return
189189
}
190+
if (!System.getenv("CI").isNullOrBlank()) {
191+
return
192+
}
190193
val token = System.getenv("SESSION")
191194
if (token.isNullOrBlank()) {
192195
return

src/test/kotlin/dev/mtib/aoc/aoc24/days/Day7Test.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package dev.mtib.aoc.aoc24.days
22

33
import io.kotest.core.spec.style.FunSpec
4+
import io.kotest.matchers.shouldBe
45

56
class Day7Test : FunSpec({
67
val snippet0 = """
@@ -22,6 +23,12 @@ class Day7Test : FunSpec({
2223
// Ignore allowed exception
2324
}
2425
}
26+
27+
test("example") {
28+
Day7.withInput(snippet0) {
29+
Day7.part1() shouldBe 3749.toBigInteger()
30+
}
31+
}
2532
}
2633
context("part2") {
2734
test("doesn't throw") {
@@ -31,5 +38,10 @@ class Day7Test : FunSpec({
3138
// Ignore allowed exception
3239
}
3340
}
41+
test("example") {
42+
Day7.withInput(snippet0) {
43+
Day7.part2() shouldBe 11387.toBigInteger()
44+
}
45+
}
3446
}
3547
})

0 commit comments

Comments
 (0)