Add github workflow to check scala code is formatted

This commit is contained in:
Matthew de Detrich 2022-11-05 15:53:07 +01:00 committed by Matthew de Detrich
parent a4e5df5e9c
commit 1ca5139f28
2 changed files with 28 additions and 4 deletions

View file

@ -9,8 +9,8 @@ concurrency:
cancel-in-progress: true
jobs:
check-code-style:
name: Check / Code Style
check-headers:
name: Check / Headers
runs-on: ubuntu-20.04
steps:
- name: Checkout
@ -27,12 +27,12 @@ jobs:
- name: Cache Coursier cache
uses: coursier/cache-action@v6.2
- name: Code style check
- name: Check headers
run: |-
sbt -jvm-opts .jvmopts-ci \
-Dsbt.override.build.repos=false \
-Dsbt.log.noformat=false \
verifyCodeStyle
headerCheckAll
pull-request-validation:
name: Check / Tests

24
.github/workflows/format.yml vendored Normal file
View file

@ -0,0 +1,24 @@
name: Scalafmt
permissions: read-all
on:
pull_request:
branches: ['**']
jobs:
build:
name: Code is formatted
runs-on: ubuntu-latest
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false
- name: Check project is formatted
uses: jrouly/scalafmt-native-action@v2
with:
version: '3.6.1'
arguments: '--list --mode diff-ref=origin/main'