-
Notifications
You must be signed in to change notification settings - Fork 186
113 lines (96 loc) · 3.14 KB
/
unit-test.yml
File metadata and controls
113 lines (96 loc) · 3.14 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: Unit Tests
on:
push:
branches:
- main
- 'release/**'
pull_request:
branches:
- main
- 'release/**'
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
include:
- os: windows-latest
framework: 'net48|net8.0'
- os: ubuntu-latest
framework: 'net8.0'
- os: macos-latest
framework: 'net8.0'
env:
SOLUTION: 'Appium.Net.sln'
BUILD_PLATFORM: 'Any CPU'
BUILD_CONFIGURATION: 'Release'
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '8.0.x'
- name: Setup NuGet (Windows)
if: runner.os == 'Windows'
uses: NuGet/setup-nuget@v2
- name: Restore NuGet packages (Windows)
if: runner.os == 'Windows'
run: nuget restore ${{ env.SOLUTION }}
- name: Restore NuGet packages (Linux/macOS)
if: runner.os != 'Windows'
run: dotnet restore ${{ env.SOLUTION }}
- name: Setup MSBuild (Windows)
if: runner.os == 'Windows'
uses: microsoft/setup-msbuild@v2
- name: Build solution (Windows)
if: runner.os == 'Windows'
run: |
msbuild ${{ env.SOLUTION }} `
/p:DeployOnBuild=true `
/p:WebPublishMethod=Package `
/p:PackageAsSingleFile=true `
/p:SkipInvalidConfigurations=true `
/p:DesktopBuildPackageLocation="${{ runner.temp }}\WebApp.zip" `
/p:DeployIisAppPath="Default Web Site" `
/p:Configuration=${{ env.BUILD_CONFIGURATION }} `
/p:Platform="${{ env.BUILD_PLATFORM }}" `
/m
- name: Build solution (Linux/macOS)
if: runner.os != 'Windows'
run: dotnet build ${{ env.SOLUTION }} --configuration ${{ env.BUILD_CONFIGURATION }}
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 'lts/*'
- name: Install Appium
run: npm install -g appium
- name: Run .NET Framework 4.8 unit tests
if: runner.os == 'Windows'
run: |
dotnet test `
--no-build `
--configuration ${{ env.BUILD_CONFIGURATION }} `
--filter "AppiumLocalServerLaunchingTest|DirectConnectTest|AppiumClientConfigTest" `
--framework net48 `
--logger "trx;LogFileName=test-results-net48.trx" `
./test/integration/Appium.Net.Integration.Tests.csproj
- name: Run .NET 8 unit tests
run: |
dotnet test \
--no-build \
--configuration ${{ env.BUILD_CONFIGURATION }} \
--filter "AppiumLocalServerLaunchingTest|DirectConnectTest|AppiumClientConfigTest" \
--framework net8.0 \
--logger "trx;LogFileName=test-results-net8-${{ matrix.os }}.trx" \
./test/integration/Appium.Net.Integration.Tests.csproj
shell: bash
- name: Publish test results
uses: dorny/test-reporter@v2
if: always()
with:
name: Test Results (${{ matrix.os }})
path: '**/test-results-*.trx'
reporter: dotnet-trx