Skip to content

Commit

Permalink
update readme and pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
kcinay055679 committed Nov 15, 2024
1 parent ca27335 commit 327baba
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 48 deletions.
47 changes: 8 additions & 39 deletions .github/workflows/format-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: 'Format'
on: [push]
jobs:

Frontend:
frontend:
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -15,33 +15,19 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.10.0
node-version: ${{vars.NODE_VERSION}}

- name: Npm install
run: npm ci

- name: Format frontend
run: npm run format
run: npm run check

- name: Commit and Push formated frontend
shell: bash
env:
COMMITPREFIX: '[FM]'
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
git add . || {
echo "No files were changed, so we did not commit anything"
exit 1
}
git commit -m "$COMMITPREFIX Automated formating frontend" || {
echo "No changes to commit, skipping push"
exit 0
}
git push -f
Backend:
backend:
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -55,21 +41,4 @@ jobs:
settings-path: ${{github.workspace}}

- name: Format backend
run: mvn formatter:format -f backend/pom.xml

- name: Commit and Push formated backend
shell: bash
env:
COMMITPREFIX: '[FM]'
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
git add . || {
echo "No files were changed, so we did not commit anything"
exit 1
}
git commit -m "$COMMITPREFIX Automated formating backend" || {
echo "No changes to commit, skipping push"
exit 0
}
git push -f
run: mvn spotless:check
11 changes: 5 additions & 6 deletions backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,16 @@ USING DOCKER
- backend/target

Formatting:
- Check code formatting: `mvn formatter:validate`
- Format the code: `mvn formatter:format`
- Check code formatting: `mvn spotless:check`
- Format the code: `mvn spotless:apply`

The `compile` goal execute also a `formatter:format` goal.
The `compile` goal execute also a `spotless:apply` goal.

Verify the Backend for coverage check:
- `mvn clean verify`

## Formatting
We use the **formatter-maven-plugin** Plugin for formatting the Java code:
https://code.revelc.net/formatter-maven-plugin/

We use the **spotless** Plugin for formatting the Java code:
https://github.com/diffplug/spotless
## Build
_tbd_
6 changes: 3 additions & 3 deletions backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,9 @@
<build>
<plugins>
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<version>2.24.1</version>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.43.0</version>
<executions>
<execution>
<id>code-format</id>
Expand Down

0 comments on commit 327baba

Please sign in to comment.