Update sbt-scalafmt to 2.6.2 #196
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI Build | |
| on: | |
| push: | |
| branches: [ master ] | |
| tags: [ '*' ] | |
| pull_request: | |
| branches: [ master ] | |
| types: [ opened, reopened, labeled, synchronize ] | |
| jobs: | |
| check-formatting: | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' || github.event.action != 'labeled' # run for 'opened', 'reopened' and 'synchronize' | |
| name: Check formatting | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - uses: coursier/setup-action@v3.0.0 | |
| with: | |
| apps: scalafmt | |
| - name: Check code and docs formatting | |
| run: scalafmt --check | |
| check-snippets: | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' || github.event.action != 'labeled' # run for 'opened', 'reopened' and 'synchronize' | |
| name: Check Scala CLI snippets from documentation | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - uses: extractions/setup-just@v4 | |
| - uses: coursier/setup-action@v3.0.0 | |
| with: | |
| # publish-local-for-tests builds Scala 3 artifacts with -release 17 (Scala 2.13 uses -release 11), | |
| # so the snippets job needs JDK 17+ - don't rely on the runner's default JVM. | |
| jvm: 'temurin:17' | |
| apps: scala-cli sbt | |
| - name: Run snippets from documentation | |
| working-directory: docs | |
| # TODO(hearth-release): drop COURSIER_REPOSITORIES once versions.hearth is a released Hearth. While it is a | |
| # SNAPSHOT, the snippets' scala-cli builds resolve chimney -> hearth SNAPSHOT, which is not on Central releases; | |
| # this points coursier at ivy2local (publish-local-for-tests) + Central releases + Central snapshots. | |
| env: | |
| COURSIER_REPOSITORIES: "ivy2Local|central|https://central.sonatype.com/repository/maven-snapshots" | |
| run: just test-snippets | |
| build: | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' || github.event.action != 'labeled' # run for 'opened', 'reopened' and 'synchronize' | |
| name: "Scala: ${{ matrix.scala == '2_12' && '2.12' || matrix.scala == '2_13' && '2.13' || '3' }} / Platform: ${{ matrix.platform }} / JVM: ${{ matrix.jvm }}" | |
| strategy: | |
| matrix: | |
| scala: ["2_13", "3"] | |
| platform: ["jvm", "js", "native"] | |
| # sbt 2.x requires JDK 17+ to run, so JDK 17 is the floor for every job (the old Scala 2.13-on-JDK-11 | |
| # job is no longer possible - sbt itself won't start on 11). Emitted artifacts stay JDK-11 compatible | |
| # for Scala 2.13 (-release 11) and JDK-17 for Scala 3 (-release 17) via the -release flags; each Scala | |
| # version is also exercised on the latest LTS. | |
| jvm: ['temurin:17', 'temurin:1.21.0.1'] | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - uses: coursier/cache-action@v8 | |
| - uses: coursier/setup-action@v3.0.0 | |
| with: | |
| jvm: ${{ matrix.jvm }} | |
| apps: sbt | |
| - name: Clean, compile, test, generate coverage report, check MiMa | |
| run: sbt ci-${{ matrix.platform }}-${{ matrix.scala }} | |
| - uses: codecov/codecov-action@v7 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} |