Some checks failed
CI Demo / build (push) Successful in 4s
Docker Test / docker-ops (push) Successful in 5s
.NET Test / dotnet-test (push) Successful in 51s
Java Test / java-hello (push) Has been cancelled
Julia Test / julia-test (push) Has been cancelled
Kotlin Test / kotlin-hello (push) Has been cancelled
Node.js Test / nodejs-test (push) Has been cancelled
Notebook Test / nb-test (push) Has been cancelled
PHP Test / php-test (push) Has been cancelled
Python Test / python-hello (push) Has been cancelled
R tests / test (push) Has been cancelled
Go Test / go-test (push) Has been cancelled
Rust test / test (push) Has been cancelled
Scala (sbt) tests / scala-test (push) Has been cancelled
Swift Test / swift-hello (push) Has been cancelled
51 lines
1.7 KiB
YAML
51 lines
1.7 KiB
YAML
name: Scala (sbt) tests
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
scala-test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
# Find an sbt project (first build.sbt found). If none, we skip gracefully.
|
|
- name: Detect sbt project
|
|
id: detect
|
|
shell: bash
|
|
run: |
|
|
set -e
|
|
FILE=$(git ls-files '**/build.sbt' | head -n1 || true)
|
|
if [ -z "$FILE" ]; then
|
|
echo "found=false" >> "$GITHUB_OUTPUT"
|
|
exit 0
|
|
fi
|
|
DIR=$(dirname "$FILE")
|
|
echo "found=true" >> "$GITHUB_OUTPUT"
|
|
echo "dir=$DIR" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Set up Java (for sbt)
|
|
if: steps.detect.outputs.found == 'true'
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: temurin
|
|
java-version: '11' # or 17/21 to match your project
|
|
cache: sbt
|
|
# Limit cache scan to the detected project to avoid the "no file matched" error
|
|
cache-dependency-path: |
|
|
${{ steps.detect.outputs.dir }}/build.sbt
|
|
${{ steps.detect.outputs.dir }}/project/build.properties
|
|
${{ steps.detect.outputs.dir }}/project/**/*.scala
|
|
${{ steps.detect.outputs.dir }}/project/**/*.sbt
|
|
|
|
- name: Set up sbt
|
|
if: steps.detect.outputs.found == 'true'
|
|
uses: sbt/setup-sbt@v1
|
|
|
|
- name: Run tests
|
|
if: steps.detect.outputs.found == 'true'
|
|
working-directory: ${{ steps.detect.outputs.dir }}
|
|
run: sbt -batch -v test
|
|
|
|
- name: Skip (no sbt project found)
|
|
if: steps.detect.outputs.found != 'true'
|
|
run: echo "No sbt project found; skipping Scala tests."
|