From d96fda895eb2c8230e1c790c30476dbdc5d43e6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Costa?= Date: Wed, 29 Nov 2023 21:00:38 +0100 Subject: [PATCH] Test g8 templates --- .github/workflows/compile_test.yml | 48 ++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/.github/workflows/compile_test.yml b/.github/workflows/compile_test.yml index 11f8067c..a40258ca 100644 --- a/.github/workflows/compile_test.yml +++ b/.github/workflows/compile_test.yml @@ -6,6 +6,7 @@ env: CI: true # disables SBT super shell which has problems with CI environments jobs: + compile-lib: name: Compile library and test runs-on: ubuntu-latest @@ -51,6 +52,7 @@ jobs: run: sbt -J-Xmx3G -Dsbt.color=always ++$SCALA_VERSION $PROJECT/test:compile - name: Run tests (Scala ${{ matrix.scala }} - ${{ matrix.platform }}) run: sbt -J-Xmx3G -Dsbt.color=always ++$SCALA_VERSION $PROJECT/test + compile-examples: name: Compile examples runs-on: ubuntu-latest @@ -95,6 +97,52 @@ jobs: run: | cd examples/snapshot ls | grep .sc | xargs scala-cli compile + + compile-templates: + name: Compile examples + runs-on: ubuntu-latest + + strategy: + fail-fast: true + + steps: + - uses: actions/checkout@v2 + - name: Set up Java 17 and SBT + uses: actions/setup-java@v2 + with: + distribution: temurin + java-version: 17 + - name: Cache Coursier + uses: actions/cache@v1 + with: + path: ~/.cache/coursier + key: ${{ runner.os }}-coursier-${{ hashFiles('**/*.sbt') }} + - name: Cache SBT ivy cache + uses: actions/cache@v1 + with: + path: ~/.ivy2/cache + key: ${{ runner.os }}-sbt-ivy-cache-${{ hashFiles('**/build.sbt') }} + - name: Cache SBT + uses: actions/cache@v1 + with: + path: ~/.sbt + key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt') }} + - name: Install Scala-CLI + run: | + curl -fL https://github.com/Virtuslab/scala-cli/releases/latest/download/scala-cli-x86_64-pc-linux.gz | gzip -d > scala-cli + chmod +x scala-cli + sudo mv scala-cli /usr/local/bin/scala-cli + - name: Compile templates (Scala CLI) + run: | + scala-cli --power new file://./src/main/g8 --name=scala-cli-g8-test + cd scala-cli-g8-test + scala-cli compile . + - name: Compile templates (SBT) + run: | + scala-cli --power new file://./src/main/g8 --name=sbt-g8-test --sbt_project=yes + cd sbt-g8-test + sbt compile + coverage: name: Code coverage runs-on: ubuntu-latest