Skip to content

Commit 908d42e

Browse files
committed
changes
1 parent 287c740 commit 908d42e

2 files changed

Lines changed: 65 additions & 15 deletions

File tree

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
1-
name: CI
1+
name: PR Tests - Linux
22

33
on:
44
pull_request:
55
branches: [ main ]
66

7-
87
jobs:
98
build:
109
runs-on: ubuntu-latest
1110
strategy:
1211
matrix:
13-
dotnet-version: [6.0, 7.0, 8.0, 9.0]
12+
include:
13+
- dotnet-version: 6.0
14+
tfm: net6.0
15+
- dotnet-version: 7.0
16+
tfm: net7.0
17+
- dotnet-version: 8.0
18+
tfm: net8.0
19+
- dotnet-version: 9.0
20+
tfm: net9.0
1421
steps:
1522
- name: Checkout repository
1623
uses: actions/checkout@v4
@@ -20,8 +27,26 @@ jobs:
2027
with:
2128
dotnet-version: ${{ matrix.dotnet-version }}
2229

23-
- name: Run tests
30+
- name: Restore (test project only, pinned TF)
31+
run: |
32+
echo "Restoring test project for framework ${{ matrix.tfm }}"
33+
dotnet restore ./cas-dotnet-sdk-tests/cas-dotnet-sdk-tests.csproj --framework ${{ matrix.tfm }}
34+
35+
- name: Build (override framework)
2436
run: |
25-
# Run tests that target the runtime matching the SDK where possible.
26-
# Most test projects will run fine with the installed SDK.
27-
dotnet test ./cas-dotnet-sdk-tests/cas-dotnet-sdk-tests.csproj -c Release --logger "trx"
37+
echo "Building solution for framework ${{ matrix.tfm }}"
38+
dotnet build ./cas-dotnet-sdk.sln -c Release --no-restore -f ${{ matrix.tfm }}
39+
40+
- name: Run tests (override framework)
41+
run: |
42+
echo "Running tests for framework ${{ matrix.tfm }}"
43+
dotnet test ./cas-dotnet-sdk-tests/cas-dotnet-sdk-tests.csproj -c Release --no-build -f ${{ matrix.tfm }} --logger "trx"
44+
45+
- name: Upload test results
46+
if: always()
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: TestResults-dotnet-${{ matrix.dotnet-version }}
50+
path: |
51+
**/TestResults/*.trx
52+
**/*.trx
Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
1-
name: CI
1+
name: PR Tests - Windows
22

33
on:
44
pull_request:
55
branches: [ main ]
66

7-
87
jobs:
98
build:
10-
runs-on: windows-latest
9+
runs-on: ubuntu-latest
1110
strategy:
1211
matrix:
13-
dotnet-version: [6.0, 7.0, 8.0, 9.0]
12+
include:
13+
- dotnet-version: 6.0
14+
tfm: net6.0
15+
- dotnet-version: 7.0
16+
tfm: net7.0
17+
- dotnet-version: 8.0
18+
tfm: net8.0
19+
- dotnet-version: 9.0
20+
tfm: net9.0
1421
steps:
1522
- name: Checkout repository
1623
uses: actions/checkout@v4
@@ -20,8 +27,26 @@ jobs:
2027
with:
2128
dotnet-version: ${{ matrix.dotnet-version }}
2229

23-
- name: Run tests
30+
- name: Restore (test project only, pinned TF)
31+
run: |
32+
echo "Restoring test project for framework ${{ matrix.tfm }}"
33+
dotnet restore ./cas-dotnet-sdk-tests/cas-dotnet-sdk-tests.csproj --framework ${{ matrix.tfm }}
34+
35+
- name: Build (override framework)
2436
run: |
25-
# Run tests that target the runtime matching the SDK where possible.
26-
# Most test projects will run fine with the installed SDK.
27-
dotnet test ./cas-dotnet-sdk-tests/cas-dotnet-sdk-tests.csproj -c Release --logger "trx"
37+
echo "Building solution for framework ${{ matrix.tfm }}"
38+
dotnet build ./cas-dotnet-sdk.sln -c Release --no-restore -f ${{ matrix.tfm }}
39+
40+
- name: Run tests (override framework)
41+
run: |
42+
echo "Running tests for framework ${{ matrix.tfm }}"
43+
dotnet test ./cas-dotnet-sdk-tests/cas-dotnet-sdk-tests.csproj -c Release --no-build -f ${{ matrix.tfm }} --logger "trx"
44+
45+
- name: Upload test results
46+
if: always()
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: TestResults-dotnet-${{ matrix.dotnet-version }}
50+
path: |
51+
**/TestResults/*.trx
52+
**/*.trx

0 commit comments

Comments
 (0)