Skip to content

ci: correction for c# formatting and to use java 17 #1

ci: correction for c# formatting and to use java 17

ci: correction for c# formatting and to use java 17 #1

Workflow file for this run

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.Core.sln
- name: Reformat
run: |
jb cleanupcode --profile="Full Cleanup With Headers" ArmoniK.Core.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
format-terraform:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
with:
ref: ${{ github.ref }}
- name: Check Format
run: terraform fmt -check -recursive -diff