-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: correction for c# formatting and to use java 17 (#241)
- Loading branch information
Showing
5 changed files
with
88 additions
and
79 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
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,57 @@ | ||
name: Code Formatting | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
format-csharp: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 | ||
with: | ||
ref: ${{ github.ref }} | ||
|
||
- name: Install .NET Core | ||
uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3 | ||
with: | ||
dotnet-version: 6.x | ||
|
||
- name: Install ReSharper | ||
run: | | ||
dotnet tool install -g JetBrains.ReSharper.GlobalTools --version 2022.2.2 | ||
- name: Restore | ||
run: | | ||
dotnet restore ArmoniK.Extensions.Csharp.sln | ||
- name: Reformat | ||
run: | | ||
jb cleanupcode --exclude="**.props" ArmoniK.Extensions.Csharp.sln | ||
- name: Check Diff | ||
id: check-diff | ||
run: | | ||
DIFF="$(git diff --name-only)" | ||
if [ -z "$DIFF" ]; then | ||
echo "OK: Format is clean" | ||
else | ||
echo "Error: Format was not clean" | ||
echo "List of files:" | ||
echo "$DIFF" | ||
git diff | ||
exit 1 | ||
fi | ||
- name: Generate patch | ||
if: ${{ failure() && steps.check-diff.conclusion == 'failure' }} | ||
run: | | ||
git diff > patch-csharp.diff | ||
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3 | ||
if: ${{ failure() && steps.check-diff.conclusion == 'failure' }} | ||
with: | ||
name: patch-csharp | ||
path: ./patch-csharp.diff |
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