From 9edc47b48bdb3319d665cb6f33e2c29ffc316144 Mon Sep 17 00:00:00 2001 From: Raphael Anyanwu <53215747+selfmadecode@users.noreply.github.com> Date: Tue, 21 Jan 2025 23:55:38 +0100 Subject: [PATCH 1/4] add PR validation github action command --- .github/workflows/PR_validation.yml | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/PR_validation.yml diff --git a/.github/workflows/PR_validation.yml b/.github/workflows/PR_validation.yml new file mode 100644 index 0000000..d44ad29 --- /dev/null +++ b/.github/workflows/PR_validation.yml @@ -0,0 +1,30 @@ +name: PR Validation + +on: + pull_request: + branches: + - main +jobs: + validate: + name: Build and Test + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Setup .NET SDK + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '8.0' + - name: Restore Dependencies + run: dotnet restore + + - name: Build Project + run: dotnet build --no-restore --configuration Release + + - name: Run Unit Tests + run: dotnet test --no-build --verbosity normal + + - name: Run Code Formatter + run: dotnet format --check From 2201329e92651a6a5918a998b0514de3fcb5ed08 Mon Sep 17 00:00:00 2001 From: Raphael Anyanwu <53215747+selfmadecode@users.noreply.github.com> Date: Wed, 22 Jan 2025 00:05:18 +0100 Subject: [PATCH 2/4] Update PR validation rule --- .github/workflows/PR_validation.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/PR_validation.yml b/.github/workflows/PR_validation.yml index d44ad29..9d93ed7 100644 --- a/.github/workflows/PR_validation.yml +++ b/.github/workflows/PR_validation.yml @@ -17,6 +17,10 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: '8.0' + + - name: Clean Project + run: dotnet clean + - name: Restore Dependencies run: dotnet restore @@ -24,7 +28,7 @@ jobs: run: dotnet build --no-restore --configuration Release - name: Run Unit Tests - run: dotnet test --no-build --verbosity normal + run: dotnet test --no-build --logger "trx;LogFileName=TestResults.trx" --verbosity detailed - name: Run Code Formatter run: dotnet format --check From 89cee3872ada4cf496bcbabbd0abbf370ad8dea6 Mon Sep 17 00:00:00 2001 From: Raphael Anyanwu <53215747+selfmadecode@users.noreply.github.com> Date: Wed, 22 Jan 2025 00:10:02 +0100 Subject: [PATCH 3/4] remove unit tests action --- .github/workflows/PR_validation.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/PR_validation.yml b/.github/workflows/PR_validation.yml index 9d93ed7..c114435 100644 --- a/.github/workflows/PR_validation.yml +++ b/.github/workflows/PR_validation.yml @@ -27,8 +27,8 @@ jobs: - name: Build Project run: dotnet build --no-restore --configuration Release - - name: Run Unit Tests - run: dotnet test --no-build --logger "trx;LogFileName=TestResults.trx" --verbosity detailed + ##- name: Run Unit Tests + #run: dotnet test --no-build --logger "trx;LogFileName=TestResults.trx" --verbosity detailed - name: Run Code Formatter run: dotnet format --check From 87ebbb4113e911ab76f457b2e46f9048ae13e70d Mon Sep 17 00:00:00 2001 From: Raphael Anyanwu <53215747+selfmadecode@users.noreply.github.com> Date: Wed, 22 Jan 2025 00:12:42 +0100 Subject: [PATCH 4/4] Update PR_validation.yml --- .github/workflows/PR_validation.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/PR_validation.yml b/.github/workflows/PR_validation.yml index c114435..94a6375 100644 --- a/.github/workflows/PR_validation.yml +++ b/.github/workflows/PR_validation.yml @@ -30,5 +30,5 @@ jobs: ##- name: Run Unit Tests #run: dotnet test --no-build --logger "trx;LogFileName=TestResults.trx" --verbosity detailed - - name: Run Code Formatter - run: dotnet format --check + # - name: Run Code Formatter + # run: dotnet format --check