Skip to content

Commit 57f2b6d

Browse files
committed
Add multi-platform testing (Windows, Linux, macOS) to all workflows
1 parent 25acce1 commit 57f2b6d

4 files changed

Lines changed: 112 additions & 7 deletions

File tree

‎.github/workflows/01-pr-validation.yml‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@ on:
55
branches: [ develop ]
66

77
jobs:
8-
build:
9-
runs-on: ubuntu-latest
8+
test-multiplatform:
9+
name: Test on ${{ matrix.os }}
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
matrix:
13+
os: [ubuntu-latest, windows-latest, macos-latest]
1014
permissions:
1115
contents: read
1216

@@ -45,3 +49,4 @@ jobs:
4549
run: dotnet test -c Release --no-build --no-restore --verbosity normal
4650
working-directory: ./src
4751

52+

‎.github/workflows/02-develop-build-alpha.yml‎

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,42 @@ on:
55
branches: [ develop ]
66

77
jobs:
8-
prerelease:
8+
test-multiplatform:
9+
name: Test on ${{ matrix.os }}
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
matrix:
13+
os: [ubuntu-latest, windows-latest, macos-latest]
14+
permissions:
15+
contents: read
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Setup .NET
24+
uses: actions/setup-dotnet@v4
25+
with:
26+
dotnet-version: 8.0.x
27+
28+
- name: Restore dependencies
29+
run: dotnet restore
30+
working-directory: ./src
31+
32+
- name: Build solution
33+
run: dotnet build -c Release --no-restore
34+
working-directory: ./src
35+
36+
- name: Run tests
37+
run: dotnet test -c Release --no-build --no-restore --verbosity normal
38+
working-directory: ./src
39+
40+
build-artifacts:
41+
name: Build alpha artifacts
942
runs-on: ubuntu-latest
43+
needs: test-multiplatform
1044
permissions:
1145
packages: write
1246
contents: read
@@ -39,10 +73,6 @@ jobs:
3973
run: dotnet build -c Release --no-restore -p:Version=${{ steps.gv.outputs.SemVer }} -p:AssemblyVersion=${{ steps.gv.outputs.AssemblySemVer }} -p:FileVersion=${{ steps.gv.outputs.AssemblySemFileVer }}
4074
working-directory: ./src
4175

42-
- name: Run tests
43-
run: dotnet test -c Release --no-build --no-restore --verbosity normal
44-
working-directory: ./src
45-
4676
- name: Pack NuGet packages (alpha)
4777
run: dotnet pack -c Release --no-restore -o ../artifacts -p:Version=${{ steps.gv.outputs.SemVer }}
4878
working-directory: ./src
@@ -54,3 +84,4 @@ jobs:
5484
path: artifacts
5585
retention-days: 7
5686

87+

‎.github/workflows/03-publish-prerelease.yml‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,41 @@ concurrency:
88
cancel-in-progress: true
99

1010
jobs:
11+
test-multiplatform:
12+
name: Test on ${{ matrix.os }}
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest, windows-latest, macos-latest]
17+
permissions:
18+
contents: read
19+
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Setup .NET
27+
uses: actions/setup-dotnet@v4
28+
with:
29+
dotnet-version: 8.0.x
30+
31+
- name: Restore dependencies
32+
run: dotnet restore
33+
working-directory: ./src
34+
35+
- name: Build solution
36+
run: dotnet build -c Release --no-restore
37+
working-directory: ./src
38+
39+
- name: Run tests
40+
run: dotnet test -c Release --no-build --no-restore --verbosity normal
41+
working-directory: ./src
42+
1143
publish-prerelease:
1244
runs-on: ubuntu-latest
45+
needs: test-multiplatform
1346
permissions:
1447
contents: read
1548
env:
@@ -77,3 +110,4 @@ jobs:
77110
echo "Pushing prerelease package: $p"
78111
dotnet nuget push "$p" --source https://api.nuget.org/v3/index.json --api-key "$NUGET_API_KEY" --skip-duplicate
79112
done
113+

‎.github/workflows/04-publish-stable.yml‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,44 @@ concurrency:
99
cancel-in-progress: true
1010

1111
jobs:
12+
test-multiplatform:
13+
name: Test on ${{ matrix.os }}
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
matrix:
17+
os: [ubuntu-latest, windows-latest, macos-latest]
18+
permissions:
19+
contents: read
20+
21+
steps:
22+
- name: Checkout tag
23+
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
ref: ${{ github.event.release.tag_name }}
27+
28+
- name: Setup .NET
29+
uses: actions/setup-dotnet@v4
30+
with:
31+
dotnet-version: 8.0.x
32+
33+
- name: Restore dependencies
34+
run: dotnet restore
35+
working-directory: ./src
36+
37+
- name: Build solution
38+
run: dotnet build -c Release --no-restore
39+
working-directory: ./src
40+
41+
- name: Run tests
42+
run: dotnet test -c Release --no-build --no-restore --verbosity normal
43+
working-directory: ./src
44+
1245
publish:
1346
# Only process releases from develop branch
1447
if: github.event.release.target_commitish == 'develop'
1548
runs-on: ubuntu-latest
49+
needs: test-multiplatform
1650
permissions:
1751
contents: read
1852
env:
@@ -91,3 +125,4 @@ jobs:
91125
dotnet nuget push "$p" --source https://api.nuget.org/v3/index.json --api-key "$NUGET_API_KEY" --skip-duplicate
92126
done
93127
128+

0 commit comments

Comments
 (0)