-
Notifications
You must be signed in to change notification settings - Fork 10
65 lines (62 loc) · 2.3 KB
/
dotnet.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: .NET
on:
pull_request:
push:
branches: master
jobs:
test:
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v2
with:
dotnet-version: '5.0.x'
- name: Add msbuild to PATH
if: matrix.os == 'windows-latest'
uses: microsoft/setup-msbuild@v1.3
- name: Build console app
run: dotnet build SharpXMPP.Console
- name: Build WPF app
if: matrix.os == 'windows-latest'
run: |
nuget restore SharpXMPP.sln
msbuild SharpXMPP.WPF/SharpXMPP.WPF.csproj /p:Configuration=Debug /t:Rebuild
- name: Build Xamarin apps
if: matrix.os == 'macos-latest'
run: |
nuget restore SharpXMPP.sln
msbuild SharpXMPP.Xamarin/SharpXMPP.Client.iOS/SharpXMPP.Client.iOS.csproj /p:Configuration=Debug /p:Platform=iPhoneSimulator /t:Rebuild
msbuild SharpXMPP.Xamarin/SharpXMPP.Client.Droid/SharpXMPP.Client.Droid.csproj /p:Configuration=Debug /t:PackageForAndroid
- name: Run .NET 5 tests
run: dotnet test SharpXMPP.NUnit -f net5.0
- name: Configure Mono
if: matrix.os == 'ubuntu-latest'
run: |
echo "mono_path=/usr/lib/mono/4.5/" >> $GITHUB_ENV
- name: Build tests with .NET 4.8/Mono
if: matrix.os != 'macos-latest'
run: dotnet build SharpXMPP.NUnit --no-restore --configuration Release -f net48
env:
FrameworkPathOverride: ${{ env.mono_path }}
- name: Run tests with .NET 4.8/Mono
if: matrix.os != 'macos-latest'
run: dotnet test SharpXMPP.NUnit --no-restore --no-build --configuration Release -f net48
env:
FrameworkPathOverride: ${{ env.mono_path }}
- name: Build the SharpXMPP.Shared package
run: cd SharpXMPP.Shared && dotnet pack --configuration Release
if: matrix.os == 'ubuntu-latest'
- name: Build the SharpXMPP.WebSocket package
run: cd SharpXMPP.WebSocket && dotnet pack --configuration Release
if: matrix.os == 'ubuntu-latest'
- name: Upload the NuGet packages
uses: actions/upload-artifact@v4
if: matrix.os == 'ubuntu-latest'
with:
name: nuget
path: |
SharpXMPP.Shared/bin/Release/*.nupkg
SharpXMPP.WebSocket/bin/Release/*.nupkg