Add github workflow to check scala code is formatted
This commit is contained in:
parent
a4e5df5e9c
commit
1ca5139f28
2 changed files with 28 additions and 4 deletions
|
|
@ -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
24
.github/workflows/format.yml
vendored
Normal 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'
|
||||
Loading…
Add table
Add a link
Reference in a new issue