Browse Source

Test build script

Marcin Ziąbek 3 years ago
parent
commit
5f25e37f7f
1 changed files with 42 additions and 0 deletions
  1. 42 0
      .github/workflows/dotnet-desktop.yml

+ 42 - 0
.github/workflows/dotnet-desktop.yml

@@ -0,0 +1,42 @@
+name: Run Build and Unit tests
+
+on:
+  push:
+    branches: [ main ]
+  pull_request:
+    branches: [ main ]
+  workflow_dispatch:
+  schedule:
+    - cron: '3 0 * * 0'
+
+jobs:
+  main:
+    runs-on: ${{ matrix.environment }}
+    strategy:
+      matrix:
+        environment:
+          - macos-latest
+          - ubuntu-latest
+          - windows-latest
+    env:
+      DOTNET_NOLOGO: 1
+      DOTNET_CLI_TELEMETRY_OPTOUT: 1
+      NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
+      UNIT_TEST_PROJECT: QuestPDF.UnitTests/QuestPDF.UnitTests.csproj
+
+    steps:
+      - name: 📝 Fetch Sources 📝
+        uses: actions/checkout@v2
+
+      - name: ⚙ Setup .NET 6.0 SDK ⚙
+        uses: actions/setup-dotnet@v1
+        with:
+          dotnet-version: '6.0.x'
+
+      - name: 🔄 Restore Nuget Packages 🔄
+        shell: bash
+        run: dotnet restore
+
+      - name: 🛠 Build Solution 🛠
+        shell: bash
+        run: dotnet build -c Release --no-restore