From 962c58837067556538521f014f73875b8971f12c Mon Sep 17 00:00:00 2001 From: GenjiruSUchiwa Date: Wed, 20 Nov 2024 02:17:00 +0100 Subject: [PATCH] ci: update build ci --- .github/workflows/continuous.yml | 47 ++++++++++++++++---------------- build/_build.csproj.DotSettings | 8 ++++-- 2 files changed, 30 insertions(+), 25 deletions(-) diff --git a/.github/workflows/continuous.yml b/.github/workflows/continuous.yml index fa8a368..5458a14 100644 --- a/.github/workflows/continuous.yml +++ b/.github/workflows/continuous.yml @@ -1,4 +1,4 @@ -name: CI +name: Build and Test on: [ workflow_dispatch, push, pull_request ] @@ -37,48 +37,49 @@ jobs: - name: Restore dependencies run: dotnet restore - - name: Build - run: dotnet build --no-restore - - - name: Publish build artefact - run: dotnet publish --output ./output - - name: Upload artefact + - name: Build Solution + run: dotnet build --no-restore --configuration Release + + - name: Upload build artefact uses: actions/upload-artifact@v4 with: name: app-build - path: ./output + path: ./bin/Release unit_tests: runs-on: ubuntu-latest needs: [lint, build ] steps: - - name: "Verify working directory" - run: ls -R - - name: "Verify working directory" - run: ls -R - - name: Set up .NET 9 + - name: Download build artefact + uses: actions/download-artifact@v4 + with: + name: app-build + - name: Set up .NET uses: actions/setup-dotnet@v4 with: dotnet-version: '9.0.x' - + + - name: "Verify working directory" + run: ls -R + - name: Run unit tests - run: dotnet test --filter "Category=Unit" + run: dotnet test --filter "Category=Unit" --verbosity normal ./bin/Release integration_tests: runs-on: ubuntu-latest - needs: [lint, build ] + needs: [ lint, build, unit_tests ] steps: - name: Download build artefact uses: actions/download-artifact@v4 with: name: app-build - path: ./output - - name: "Verify working directory" - run: ls -R - - name: Set up .NET 9 + + - name: Set up .NET uses: actions/setup-dotnet@v4 with: dotnet-version: '9.0.x' - - - name: Run integration tests - run: dotnet test --filter "Category=Integration" + - name: "Verify working directory" + run: ls -R + + - name: Run unit tests + run: dotnet test --filter "Category=Integration" --verbosity normal ./bin/Release \ No newline at end of file diff --git a/build/_build.csproj.DotSettings b/build/_build.csproj.DotSettings index a778f33..c815d36 100755 --- a/build/_build.csproj.DotSettings +++ b/build/_build.csproj.DotSettings @@ -1,4 +1,4 @@ - + DO_NOT_SHOW DO_NOT_SHOW DO_NOT_SHOW @@ -17,11 +17,15 @@ False <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy><Descriptor Staticness="Instance" AccessRightKinds="Private" Description="Instance fields (private)"><ElementKinds><Kind Name="FIELD" /><Kind Name="READONLY_FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></Policy> + <Policy><Descriptor Staticness="Static" AccessRightKinds="Private" Description="Static fields (private)"><ElementKinds><Kind Name="FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></Policy> True True True True + True True True True - True + True + True