Skip to content

Commit f665660

Browse files
Blogbotanaclaude
andcommitted
Rewrite CI: build and test per Revit version
- Single build-and-test job with matrix revit: [2020..2026] - Build tests project (which pulls source via ProjectReference) - Run tests against the built DLL directly to avoid SDK 10 flag issues - Publish per-version results via dorny/test-reporter - Upload .trx artifact per version Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 857678c commit f665660

1 file changed

Lines changed: 26 additions & 25 deletions

File tree

.github/workflows/ci.yml

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,23 @@ name: CI
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
pull_request:
7-
branches: [ main ]
7+
branches: [main]
88

99
jobs:
10-
build:
10+
build-and-test:
11+
name: Revit ${{ matrix.revit }}
1112
runs-on: windows-latest
1213

14+
permissions:
15+
checks: write
16+
contents: read
17+
1318
strategy:
1419
fail-fast: false
1520
matrix:
16-
configuration: [R2020, R2021, R2022, R2023, R2024, R2025, R2026]
21+
revit: [2020, 2021, 2022, 2023, 2024, 2025, 2026]
1722

1823
steps:
1924
- name: Checkout
@@ -25,33 +30,29 @@ jobs:
2530
dotnet-version: 8.0.x
2631

2732
- name: Restore
28-
run: dotnet restore source/Apibim.Revit.Extensions.csproj -p:Configuration=${{ matrix.configuration }}
33+
run: dotnet restore tests/Apibim.Revit.Extensions.Tests.csproj -p:Configuration=R${{ matrix.revit }}
2934

3035
- name: Build
31-
run: dotnet build source/Apibim.Revit.Extensions.csproj -p:Configuration=${{ matrix.configuration }} --no-restore
36+
run: dotnet build tests/Apibim.Revit.Extensions.Tests.csproj -p:Configuration=R${{ matrix.revit }} --no-restore
3237

33-
test:
34-
runs-on: windows-latest
35-
needs: build
38+
- name: Run tests
39+
run: >
40+
dotnet test "tests/bin/R${{ matrix.revit }}/Apibim.Revit.Extensions.Tests.dll"
41+
--logger "trx;LogFileName=results.trx"
42+
--results-directory "${{ github.workspace }}/TestResults/${{ matrix.revit }}"
3643
37-
steps:
38-
- name: Checkout
39-
uses: actions/checkout@v4
40-
41-
- name: Setup .NET
42-
uses: actions/setup-dotnet@v4
44+
- name: Publish test results
45+
uses: dorny/test-reporter@v1
46+
if: always()
4347
with:
44-
dotnet-version: 8.0.x
45-
46-
- name: Restore
47-
run: dotnet restore tests/Apibim.Revit.Extensions.Tests.csproj -p:Configuration=R2025
48-
49-
- name: Test
50-
run: dotnet test tests/Apibim.Revit.Extensions.Tests.csproj -p:Configuration=R2025 --no-restore --logger "trx;LogFileName=test-results.trx"
48+
name: Tests – Revit ${{ matrix.revit }}
49+
path: "TestResults/${{ matrix.revit }}/results.trx"
50+
reporter: dotnet-trx
5151

52-
- name: Upload test results
52+
- name: Upload test artifact
5353
uses: actions/upload-artifact@v4
5454
if: always()
5555
with:
56-
name: test-results
57-
path: "**/TestResults/*.trx"
56+
name: test-results-${{ matrix.revit }}
57+
path: "TestResults/${{ matrix.revit }}/results.trx"
58+
if-no-files-found: warn

0 commit comments

Comments
 (0)