From b99c3a28df4a32df538454fcab97ad6793a1d63e Mon Sep 17 00:00:00 2001 From: shawiminhas <146999883+shawiminhas@users.noreply.github.com> Date: Mon, 23 Sep 2024 11:02:55 -0400 Subject: [PATCH] Create dotnet.yml (#22) * Create dotnet.yml Create workflow to run .NET build on push to main. * fixed workflow run to add working-directory * Enable Windows Targeting on workflow run * fix restoring dependencies on workflow run * enable windows targeting for all steps in workflow --- .github/workflows/dotnet.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/dotnet.yml diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml new file mode 100644 index 0000000..aa0fc37 --- /dev/null +++ b/.github/workflows/dotnet.yml @@ -0,0 +1,31 @@ +# This workflow will build a .NET project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net + +name: .NET + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + - name: Restore dependencies + run: dotnet restore /p:EnableWindowsTargeting=true + working-directory: DAIRemote + - name: Build + run: dotnet build --no-restore /p:EnableWindowsTargeting=true + working-directory: DAIRemote + - name: Test + run: dotnet test --no-build --verbosity normal /p:EnableWindowsTargeting=true + working-directory: DAIRemote