From e07e7cc6b5ff27dc38e4159fdd619b616e7d0b17 Mon Sep 17 00:00:00 2001 From: jonasblunck Date: Wed, 2 Jul 2025 14:18:08 +0200 Subject: [PATCH 1/4] Add PR build --- .github/workflows/pr-build-test.yml | 62 +++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/pr-build-test.yml diff --git a/.github/workflows/pr-build-test.yml b/.github/workflows/pr-build-test.yml new file mode 100644 index 0000000..3a31e51 --- /dev/null +++ b/.github/workflows/pr-build-test.yml @@ -0,0 +1,62 @@ +name: Build and Test on PR + +on: + pull_request: + branches: [ master ] + push: + branches: [ master ] + +jobs: + build-and-test: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.0.x' + + - name: Restore dependencies + run: dotnet restore ccm.sln + + - name: Build solution + run: dotnet build ccm.sln --configuration Release --no-restore + + - name: Run tests + run: dotnet test ccm.sln --configuration Release --no-build --verbosity normal --logger trx --results-directory TestResults + + - name: Upload test results + uses: actions/upload-artifact@v4 + if: always() + with: + name: test-results + path: TestResults/*.trx + + build-matrix: + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + dotnet-version: ['8.0.x'] + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ matrix.dotnet-version }} + + - name: Restore dependencies + run: dotnet restore ccm.sln + + - name: Build solution + run: dotnet build ccm.sln --configuration Release --no-restore + + - name: Run tests + run: dotnet test ccm.sln --configuration Release --no-build --verbosity normal From 84a76838d68aa065f07933dd3cc042628d2c2d00 Mon Sep 17 00:00:00 2001 From: jonasblunck Date: Wed, 2 Jul 2025 14:20:29 +0200 Subject: [PATCH 2/4] Only run on Windows --- .github/workflows/pr-build-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-build-test.yml b/.github/workflows/pr-build-test.yml index 3a31e51..e9664bb 100644 --- a/.github/workflows/pr-build-test.yml +++ b/.github/workflows/pr-build-test.yml @@ -38,7 +38,7 @@ jobs: build-matrix: strategy: matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + os: [windows-latest] dotnet-version: ['8.0.x'] runs-on: ${{ matrix.os }} From f31ea4988dc582248644751bc6aa063af43eeb7f Mon Sep 17 00:00:00 2001 From: jonasblunck Date: Wed, 2 Jul 2025 14:23:46 +0200 Subject: [PATCH 3/4] Only run on Mac --- .github/workflows/pr-build-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-build-test.yml b/.github/workflows/pr-build-test.yml index e9664bb..f040a1d 100644 --- a/.github/workflows/pr-build-test.yml +++ b/.github/workflows/pr-build-test.yml @@ -8,7 +8,7 @@ on: jobs: build-and-test: - runs-on: ubuntu-latest + runs-on: macos-latest steps: - name: Checkout code @@ -38,7 +38,7 @@ jobs: build-matrix: strategy: matrix: - os: [windows-latest] + os: [macos-latest] dotnet-version: ['8.0.x'] runs-on: ${{ matrix.os }} From 93ea4e480c4947842d7b6004c799a0cc17851511 Mon Sep 17 00:00:00 2001 From: jonasblunck Date: Wed, 2 Jul 2025 14:24:54 +0200 Subject: [PATCH 4/4] Remove matrix --- .github/workflows/pr-build-test.yml | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/.github/workflows/pr-build-test.yml b/.github/workflows/pr-build-test.yml index f040a1d..8a78c69 100644 --- a/.github/workflows/pr-build-test.yml +++ b/.github/workflows/pr-build-test.yml @@ -34,29 +34,3 @@ jobs: with: name: test-results path: TestResults/*.trx - - build-matrix: - strategy: - matrix: - os: [macos-latest] - dotnet-version: ['8.0.x'] - - runs-on: ${{ matrix.os }} - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: ${{ matrix.dotnet-version }} - - - name: Restore dependencies - run: dotnet restore ccm.sln - - - name: Build solution - run: dotnet build ccm.sln --configuration Release --no-restore - - - name: Run tests - run: dotnet test ccm.sln --configuration Release --no-build --verbosity normal