From c2834ba792404c8c24deeaafa7bc2e50c4986fa2 Mon Sep 17 00:00:00 2001 From: RealMG Date: Thu, 21 May 2026 21:43:39 +0700 Subject: [PATCH] ci: add ci for build project --- .github/workflows/dotnet-desktop.yml | 41 ++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/dotnet-desktop.yml diff --git a/.github/workflows/dotnet-desktop.yml b/.github/workflows/dotnet-desktop.yml new file mode 100644 index 0000000..fea4d53 --- /dev/null +++ b/.github/workflows/dotnet-desktop.yml @@ -0,0 +1,41 @@ +name: .NET Build and Publish + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + + build: + strategy: + matrix: + os: [windows-latest, ubuntu-latest, macos-latest] + configuration: [Debug, Release] + + runs-on: ${{ matrix.os }} + + env: + Solution_Name: SmallRuleAI.sln + Project_Path: src/SRA.csproj + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + + - name: Restore dependencies + run: dotnet restore ${{ env.Solution_Name }} + + - name: Build + run: dotnet build ${{ env.Solution_Name }} --configuration ${{ matrix.configuration }} --no-restore + + - name: Test + run: dotnet test ${{ env.Solution_Name }} --configuration ${{ matrix.configuration }} --no-build --verbosity normal