format build files #934
Workflow file for this run
This file contains 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: build | |
on: | |
pull_request: | |
branches: ['series/*'] | |
push: | |
branches: ['series/*'] | |
tags: ["v[0-9]+*"] | |
jobs: | |
jvm-tests: | |
name: JVM / scala ${{ matrix.scala }}, jdk ${{ matrix.java }} | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
java: [ 8, 11 ] | |
# WARN: build.sbt depends on this key path, as scalaVersion and | |
# crossScalaVersions is determined from it | |
scala: [ 2.12.15, 2.13.8, 3.1.2 ] | |
env: | |
CI: true | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: "${{ matrix.java }}" | |
distribution: adopt | |
- name: Cache ivy2 | |
uses: actions/cache@v1 | |
with: | |
path: ~/.ivy2/cache | |
key: ${{ runner.os }}-sbt-ivy-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} | |
- name: Cache coursier (linux) | |
if: contains(runner.os, 'linux') | |
uses: actions/cache@v1 | |
with: | |
path: ~/.cache/coursier/v1 | |
key: ${{ runner.os }}-sbt-coursier-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} | |
- name: Cache sbt | |
uses: actions/cache@v1 | |
with: | |
path: ~/.sbt | |
key: ${{ runner.os }}-sbt-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} | |
- name: sbt ci-jvm | |
run: ./.github/scripts/exec-sbt-command | |
env: | |
SCALA_VERSION: ${{ matrix.scala }} | |
PLATFORM: ${{ matrix.java }} | |
SBT_COMMAND: ci-jvm | |
- name: sbt reactiveTests/test | |
run: ./.github/scripts/exec-sbt-command | |
env: | |
SCALA_VERSION: ${{ matrix.scala }} | |
PLATFORM: ${{ matrix.java }} | |
SBT_COMMAND: "reactiveTests/test" | |
js-tests: | |
name: JS / scala ${{ matrix.scala }}, jdk ${{ matrix.java }} | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
# WARN: build.sbt depends on this key path, as scalaVersion and | |
# crossScalaVersions is determined from it | |
include: | |
- { java: 8, scala: 2.12.15 } | |
- { java: 8, scala: 2.13.8 } | |
- { java: 8, scala: 3.1.2 } | |
env: | |
CI: true | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: "${{ matrix.java }}" | |
distribution: adopt | |
- name: Cache ivy2 | |
uses: actions/cache@v1 | |
with: | |
path: ~/.ivy2/cache | |
key: ${{ runner.os }}-sbt-ivy-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} | |
- name: Cache coursier (linux) | |
if: contains(runner.os, 'linux') | |
uses: actions/cache@v1 | |
with: | |
path: ~/.cache/coursier/v1 | |
key: ${{ runner.os }}-sbt-coursier-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} | |
- name: Cache sbt | |
uses: actions/cache@v1 | |
with: | |
path: ~/.sbt | |
key: ${{ runner.os }}-sbt-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} | |
- name: Setup NodeJS | |
uses: actions/setup-node@v2.1.2 | |
with: | |
node-version: 14 | |
- name: sbt ci-js | |
run: | | |
./.github/scripts/exec-sbt-command | |
env: | |
SCALA_VERSION: ${{ matrix.scala }} | |
PLATFORM: ${{ matrix.java }} | |
SBT_COMMAND: ci-js | |
mima: | |
name: Mima / scala ${{ matrix.scala }}, jdk ${{ matrix.java }} | |
runs-on: ubuntu-20.04 | |
env: | |
CI: true | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- { java: 8, scala: 2.12.15 } | |
- { java: 8, scala: 2.13.8 } | |
- { java: 8, scala: 3.1.2 } | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: "${{ matrix.java }}" | |
distribution: adopt | |
- name: Cache ivy2 | |
uses: actions/cache@v1 | |
with: | |
path: ~/.ivy2/cache | |
key: ${{ runner.os }}-sbt-ivy-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} | |
- name: Cache coursier (linux) | |
if: contains(runner.os, 'linux') | |
uses: actions/cache@v1 | |
with: | |
path: ~/.cache/coursier/v1 | |
key: ${{ runner.os }}-sbt-coursier-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} | |
- name: Cache sbt | |
uses: actions/cache@v1 | |
with: | |
path: ~/.sbt | |
key: ${{ runner.os }}-sbt-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} | |
- name: sbt mimaReportBinaryIssues | |
run: | | |
./.github/scripts/exec-sbt-command | |
env: | |
SCALA_VERSION: ${{ matrix.scala }} | |
SBT_COMMAND: mimaReportBinaryIssues | |
scalafmt: | |
name: Scalafmt / scala ${{ matrix.scala }}, jdk ${{ matrix.java }} | |
runs-on: ubuntu-20.04 | |
env: | |
CI: true | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- { java: 11, scala: 2.12.15 } | |
- { java: 11, scala: 2.13.8 } | |
- { java: 11, scala: 3.1.2 } | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: "${{ matrix.java }}" | |
distribution: adopt | |
- name: Cache ivy2 | |
uses: actions/cache@v1 | |
with: | |
path: ~/.ivy2/cache | |
key: ${{ runner.os }}-sbt-ivy-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} | |
- name: Cache coursier (linux) | |
if: contains(runner.os, 'linux') | |
uses: actions/cache@v1 | |
with: | |
path: ~/.cache/coursier/v1 | |
key: ${{ runner.os }}-sbt-coursier-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} | |
- name: Cache sbt | |
uses: actions/cache@v1 | |
with: | |
path: ~/.sbt | |
key: ${{ runner.os }}-sbt-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} | |
- name: sbt scalafmtCheckAll | |
run: | | |
./.github/scripts/exec-sbt-command | |
env: | |
SCALA_VERSION: ${{ matrix.scala }} | |
SBT_COMMAND: "scalafmtCheckAll scalafmtSbtCheck" | |
unidoc: | |
name: Unidoc / scala ${{ matrix.scala }}, jdk ${{ matrix.java }} | |
runs-on: ubuntu-20.04 | |
env: | |
CI: true | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- { java: 8, scala: 2.13.8 } | |
- { java: 8, scala: 3.1.2 } | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: "${{ matrix.java }}" | |
distribution: adopt | |
- name: Cache ivy2 | |
uses: actions/cache@v1 | |
with: | |
path: ~/.ivy2/cache | |
key: ${{ runner.os }}-sbt-ivy-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} | |
- name: Cache coursier (linux) | |
if: contains(runner.os, 'linux') | |
uses: actions/cache@v1 | |
with: | |
path: ~/.cache/coursier/v1 | |
key: ${{ runner.os }}-sbt-coursier-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} | |
- name: Cache sbt | |
uses: actions/cache@v1 | |
with: | |
path: ~/.sbt | |
key: ${{ runner.os }}-sbt-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} | |
- name: sbt unidoc | |
run: | | |
./.github/scripts/exec-sbt-command | |
env: | |
SCALA_VERSION: ${{ matrix.scala }} | |
SBT_COMMAND: unidoc | |
all_tests: | |
name: All Tests | |
if: always() | |
needs: [ jvm-tests, js-tests, mima, scalafmt, unidoc ] | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Validate required tests | |
uses: re-actors/alls-green@release/v1 | |
with: | |
jobs: ${{ toJSON(needs) }} | |
publish: | |
name: Publish to Sonatype | |
if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/series/4.x') | |
needs: [ all_tests ] | |
env: | |
CI: true | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 100 | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: 8 | |
distribution: adopt | |
- name: Install GnuPG2 | |
run: | | |
./.github/scripts/setup-pgp | |
- name: .github/scripts/release | |
run: | | |
.github/scripts/release | |
env: | |
PGP_KEY_HEX: ${{ secrets.PGP_KEY_HEX }} | |
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
PUBLISH_STABLE_VERSION: false |