Merge pull request #79 from xuwei-k/scalafmt #100
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: CI | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
format: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
if: ${{ github.event_name == 'push' || github.event.pull_request.user.login == 'windymelt' }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.head_ref }} | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
cache: 'sbt' | |
- uses: coursier/cache-action@v6 | |
- name: sbt scalafmtAll | |
run: sbt scalafmtAll scalafmtSbt | |
- uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Apply scalafmt | |
build-test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
java-distribution: [ 'temurin' ] | |
java-version: [ '17' ] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: ${{ matrix.java-distribution }} | |
java-version: ${{ matrix.java-version }} | |
cache: 'sbt' | |
- uses: coursier/cache-action@v6 | |
- name: Test | |
run: sbt scalafmtSbtCheck scalafmtCheckAll test |