Skip to content

Commit

Permalink
Separate codestyle in a standalone workflow as it's done in EHRbase
Browse files Browse the repository at this point in the history
  • Loading branch information
vidi42 committed Apr 19, 2024
1 parent 5cbcd53 commit 7ae1235
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 4 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: build

# we have multiple workflows - this helps to distinguish for them
run-name: "${{ github.event.pull_request.title || github.head_ref }} - Codestyle"

on:
push:
branches: [ develop, release/* ]
Expand All @@ -23,11 +26,12 @@ jobs:
java-version: '17'
cache: 'maven'

- name: Maven - Verify, Jacoco and Package
run: mvn --batch-mode -U verify test jacoco:report-aggregate package

- name: Spotless
run: mvn -B spotless:apply

- name: Run Checks
- name: Sonar - Analyze
# Dependabot has no access to the SONAR_TOKEN secret, so we need to skip sonar.
if: ${{ github.actor != 'dependabot[bot]' }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
#
name: "CodeQL"

# we have multiple workflows - this helps to distinguish for them
run-name: "${{ github.event.pull_request.title || github.head_ref }} - Codestyle"

on:
push:
branches: [ "develop" ]
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/codestyle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: "Codestyle"

# we have multiple workflows - this helps to distinguish for them
run-name: "${{ github.event.pull_request.title || github.head_ref }} - Codestyle"

on:
push:
branches: [ develop, release/* ]
workflow_dispatch:
pull_request:
branches: [ develop ]

#
# Style-check it's a dedicated workflow. This allows us to open a PR, run all tests and fix styling issue later ;).
#
jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'

- name: Spotless
run: mvn spotless:check

0 comments on commit 7ae1235

Please sign in to comment.