Skip to content

ci: clean docker build and push image creation #258

ci: clean docker build and push image creation

ci: clean docker build and push image creation #258

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