Skip to content

Rename project to Sloth #6

Rename project to Sloth

Rename project to Sloth #6

Workflow file for this run

name: CI
on:
push:
branches: [master]
tags: ["v*"]
pull_request:
branches: [master]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
with:
distribution: temurin
java-version: 17
cache: sbt
- uses: sbt/setup-sbt@13c2c27693f0ec4a33b1ebefd04c53c4c0ba618a # v1
- name: Compile
run: sbt compile
# Tests are split by required JVM (see build.sbt). `sbt test` is intentionally disabled; each
# leg runs its own target on the JVM it needs.
#
# tests-jdk9: pure bytecode-analysis suites + the Java-9 runtime proof. Runs on Java 9 to verify
# the published (v53) artifacts actually load and execute on the oldest supported JVM.
# IMPORTANT: scala-cli-setup installs its own JVM and exports JAVA_HOME, which would clobber the
# JVM we want sbt to run on. So it MUST run BEFORE setup-java, and we additionally pin JAVA_HOME +
# PATH in the run step so both sbt AND the `java` subprocesses the tests fork use the right JDK.
#
# Runs on Temurin 11, not 9: the test harness (sbt, scala-cli, and testops' jsoniter dependency)
# needs Java 11+. The actual Java-9 floor is guaranteed by ClassfileVersionTests (all published
# classes <= v53) rather than by executing on a Java 9 JVM; Java 9/10 are best-effort.
test-jdk9:
runs-on: ubuntu-latest
timeout-minutes: 90
needs: build
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: VirtusLab/scala-cli-setup@d320e01a605bf27128a5657575382668f83ef34e # v1.14.0
- uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
id: jdk
with:
distribution: temurin
java-version: 11
cache: sbt
- uses: sbt/setup-sbt@13c2c27693f0ec4a33b1ebefd04c53c4c0ba618a # v1
- uses: coursier/cache-action@2addd381bd2c931f42d4b734b9d0c9b73aac16fb # v6
- name: Run JDK 9 test suite
env:
JAVA_HOME: ${{ steps.jdk.outputs.path }}
run: |
export PATH="$JAVA_HOME/bin:$PATH"
java -version
sbt tests-jdk9
# tests-jdk25: suites that assert presence/absence of the sun.misc.Unsafe warning, which only
# newer JDKs emit. Runs on Java 25.
test-jdk25:
runs-on: ubuntu-latest
timeout-minutes: 90
needs: build
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: VirtusLab/scala-cli-setup@d320e01a605bf27128a5657575382668f83ef34e # v1.14.0
- uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
id: jdk
with:
distribution: temurin
java-version: 25
cache: sbt
- uses: sbt/setup-sbt@13c2c27693f0ec4a33b1ebefd04c53c4c0ba618a # v1
- uses: coursier/cache-action@2addd381bd2c931f42d4b734b9d0c9b73aac16fb # v6
- name: Run JDK 25 test suite
env:
JAVA_HOME: ${{ steps.jdk.outputs.path }}
run: |
export PATH="$JAVA_HOME/bin:$PATH"
java -version
sbt tests-jdk25
publish:
needs: [build, test-jdk9, test-jdk25]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
with:
distribution: temurin
java-version: 17
cache: sbt
- uses: sbt/setup-sbt@13c2c27693f0ec4a33b1ebefd04c53c4c0ba618a # v1
- name: Publish
run: sbt ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}