-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
560 additions
and
172 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"name":"sbt","version":"1.8.3","bspVersion":"2.1.0-M1","languages":["scala"],"argv":["/home/maxim/.sdkman/candidates/java/11.0.22-tem/bin/java","-Xms100m","-Xmx100m","-classpath","/home/maxim/.sdkman/candidates/sbt/1.7.1/bin/sbt-launch.jar","-Dsbt.script=/home/maxim/.sdkman/candidates/sbt/current/bin/sbt","xsbt.boot.Boot","-bsp"]} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,68 +18,17 @@ jobs: | |
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Cache SBT | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.ivy2/cache | ||
~/.sbt | ||
key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt') }} | ||
|
||
- name: Setup JDK 8 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '8' | ||
distribution: 'temurin' | ||
|
||
- name: Setup Scala and SBT | ||
uses: olafurpg/setup-scala@v14 | ||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
with: | ||
java-version: '8' | ||
|
||
- name: Check and format code with Scalafmt | ||
run: sbt scalafmtAll | ||
cache-read-only: false | ||
cache-overwrite-existing: true | ||
|
||
- name: Check and fix code with Scalafix | ||
run: sbt scalafixAll | ||
|
||
- name: Check for changes and commit | ||
id: git-check | ||
run: | | ||
if [ -n "$(git status --porcelain | grep -v '^??')" ]; then | ||
echo "changes=true" >> $GITHUB_ENV # Use environment file to set output | ||
git config --global user.name 'GitHub Actions Bot' | ||
git config --global user.email '[email protected]' | ||
git add -u | ||
git commit -m "Apply code quality checks (auto-formatted)" | ||
git fetch --prune | ||
git pull --rebase origin ${{ github.head_ref }} | ||
git push origin HEAD:${{ github.head_ref }} | ||
else | ||
echo "No changes to commit." | ||
fi | ||
env: | ||
CI: true | ||
|
||
- name: Post retry comment | ||
if: env.changes == 'true' | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
const prNumber = context.payload.pull_request ? context.payload.pull_request.number : null; | ||
if (prNumber) { | ||
const { data: pr } = await github.rest.pulls.get({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
pull_number: prNumber, | ||
}); | ||
const newBody = pr.body + '\n\nAuto-commit applied. A retry was triggered due to a failure in formatting/linting checks.'; | ||
await github.rest.pulls.update({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
pull_number: prNumber, | ||
body: newBody | ||
}); | ||
} else { | ||
console.log('No pull request context found, unable to update PR description.'); | ||
} | ||
- name: Run all checks | ||
run: ./gradlew check |
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
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
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
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
Oops, something went wrong.