From e904c75a118babd72746b9672e1395b73d5cb32e Mon Sep 17 00:00:00 2001 From: Ostrzyciel Date: Tue, 18 Mar 2025 18:10:36 +0100 Subject: [PATCH 1/2] Add test CI --- .github/workflows/scala.yml | 42 +++++++++++++++++++ .../neverblink/jelly/cli/JellyCommand.scala | 2 +- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/scala.yml diff --git a/.github/workflows/scala.yml b/.github/workflows/scala.yml new file mode 100644 index 0000000..1a0c16d --- /dev/null +++ b/.github/workflows/scala.yml @@ -0,0 +1,42 @@ +name: Scala build and test + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +permissions: + contents: read + +jobs: + # Run scalatest + test: + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-latest + java: 17 + - os: ubuntu-latest + java: 21 + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Setup JDK + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: ${{ matrix.java }} + + - name: Setup SBT + uses: sbt/setup-sbt@v1 + + - name: Build and test + shell: bash + run: sbt -v +test diff --git a/src/main/scala/eu/neverblink/jelly/cli/JellyCommand.scala b/src/main/scala/eu/neverblink/jelly/cli/JellyCommand.scala index b92b329..118b818 100644 --- a/src/main/scala/eu/neverblink/jelly/cli/JellyCommand.scala +++ b/src/main/scala/eu/neverblink/jelly/cli/JellyCommand.scala @@ -3,7 +3,7 @@ package eu.neverblink.jelly.cli import caseapp.* import eu.neverblink.jelly.cli.JellyCommand.emptyRemainingArgs -import java.io.{ByteArrayOutputStream, PrintStream, PrintWriter} +import java.io.{ByteArrayOutputStream, PrintStream} import scala.compiletime.uninitialized object JellyCommand: From e3e9244ace8783ac34e894892b73c8a607ea5265 Mon Sep 17 00:00:00 2001 From: Ostrzyciel Date: Tue, 18 Mar 2025 18:12:51 +0100 Subject: [PATCH 2/2] Add sbt cache --- .github/workflows/scala.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/scala.yml b/.github/workflows/scala.yml index 1a0c16d..c8b1868 100644 --- a/.github/workflows/scala.yml +++ b/.github/workflows/scala.yml @@ -33,6 +33,7 @@ jobs: with: distribution: temurin java-version: ${{ matrix.java }} + cache: sbt - name: Setup SBT uses: sbt/setup-sbt@v1