Skip to content

Commit 68c4b4c

Browse files
authored
Merge branch 'main' into dependabot/nuget/test/integration/System.Text.Json-10.0.1
2 parents 5186ee7 + 53d6404 commit 68c4b4c

24 files changed

+706
-172
lines changed

.github/dependabot.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,9 @@ updates:
1313
interval: "weekly"
1414

1515
- package-ecosystem: "github-actions"
16-
# Workflow files stored in the
17-
# default location of `.github/workflows`
1816
directory: "/"
1917
schedule:
20-
# Check for updates to GitHub Actions every week
2118
interval: "weekly"
2219
commit-message:
23-
# Prefix all commit messages with "[github-actions] "
24-
prefix: "[github-actions] "
20+
prefix: "ci"
21+
include: "scope"
Lines changed: 232 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
name: Functional Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- 'release/**'
8+
pull_request:
9+
branches:
10+
- main
11+
- 'release/**'
12+
workflow_dispatch:
13+
14+
env:
15+
BUILD_CONFIGURATION: 'Release'
16+
CI: true
17+
DOTNET_VERSION: '8.0.x'
18+
NODE_VERSION: 'lts/*'
19+
20+
jobs:
21+
android-tests:
22+
runs-on: ubuntu-latest
23+
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
api-level: [32]
28+
target: [google_apis]
29+
30+
env:
31+
APPIUM_LOG_PATH: '${{ github.workspace }}/appium.log'
32+
33+
steps:
34+
- name: Checkout code
35+
uses: actions/checkout@v6
36+
37+
- name: Setup .NET
38+
uses: actions/setup-dotnet@v5
39+
with:
40+
dotnet-version: ${{ env.DOTNET_VERSION }}
41+
42+
- name: Enable KVM
43+
run: |
44+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
45+
sudo udevadm control --reload-rules
46+
sudo udevadm trigger --name-match=kvm
47+
48+
- name: Setup Java
49+
uses: actions/setup-java@v5
50+
with:
51+
distribution: 'temurin'
52+
java-version: '17'
53+
54+
- name: Setup Android SDK
55+
uses: android-actions/setup-android@v3
56+
57+
- name: AVD cache
58+
uses: actions/cache@v5
59+
id: avd-cache
60+
with:
61+
path: |
62+
~/.android/avd/*
63+
~/.android/adb*
64+
key: avd-${{ matrix.api-level }}
65+
66+
- name: Create AVD and generate snapshot for caching
67+
if: steps.avd-cache.outputs.cache-hit != 'true'
68+
uses: reactivecircus/android-emulator-runner@v2
69+
with:
70+
api-level: ${{ matrix.api-level }}
71+
target: ${{ matrix.target }}
72+
arch: x86_64
73+
force-avd-creation: false
74+
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
75+
disable-animations: false
76+
script: echo "Generated AVD snapshot for caching."
77+
78+
- name: Setup Node.js
79+
uses: actions/setup-node@v6
80+
with:
81+
node-version: ${{ env.NODE_VERSION }}
82+
83+
- name: Install Appium
84+
run: npm install -g appium
85+
86+
- name: Install Android drivers
87+
run: |
88+
appium driver install uiautomator2
89+
appium driver install espresso
90+
91+
- name: Restore dependencies
92+
run: dotnet restore Appium.Net.sln
93+
94+
- name: Build solution
95+
run: dotnet build Appium.Net.sln --configuration ${{ env.BUILD_CONFIGURATION }} --no-restore
96+
97+
- name: Create test environment file
98+
run: |
99+
cat > ./test/integration/env.json << 'EOF'
100+
{
101+
"DEV": "false",
102+
"isRemoteAppiumServer": "false",
103+
"remoteAppiumServerUri": "http://localhost:4723"
104+
}
105+
EOF
106+
107+
- name: Run Android functional tests
108+
uses: reactivecircus/android-emulator-runner@v2
109+
with:
110+
api-level: ${{ matrix.api-level }}
111+
target: ${{ matrix.target }}
112+
arch: x86_64
113+
force-avd-creation: false
114+
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
115+
disable-animations: true
116+
script: |
117+
dotnet test --configuration ${{ env.BUILD_CONFIGURATION }} --no-build --framework net8.0 --filter "FullyQualifiedName~Android|FullyQualifiedName~CustomCommand" --logger "trx;LogFileName=android-test-results.trx" --logger "console;verbosity=detailed" ./test/integration/Appium.Net.Integration.Tests.csproj
118+
119+
# Common: Publish results
120+
- name: Publish test results
121+
uses: dorny/test-reporter@v2
122+
if: always()
123+
with:
124+
name: Android Test Results (API ${{ matrix.api-level }})
125+
path: '**/android-test-results.trx'
126+
reporter: dotnet-trx
127+
128+
- name: Save server output
129+
if: always()
130+
uses: actions/upload-artifact@v6
131+
with:
132+
name: appium-android-${{ matrix.api-level }}.log
133+
path: appium*.log
134+
if-no-files-found: ignore
135+
136+
ios-tests:
137+
runs-on: macos-15
138+
139+
env:
140+
APPIUM_LOG_PATH: '${{ github.workspace }}/appium-ios.log'
141+
IOS_DEVICE_NAME: 'iPhone 16'
142+
IOS_VERSION: '18.5'
143+
XCODE_VERSION: '16.4'
144+
145+
steps:
146+
# Common: Checkout and setup
147+
- name: Checkout code
148+
uses: actions/checkout@v6
149+
150+
- name: Setup .NET
151+
uses: actions/setup-dotnet@v5
152+
with:
153+
dotnet-version: ${{ env.DOTNET_VERSION }}
154+
155+
- name: Select Xcode
156+
uses: maxim-lobanov/setup-xcode@v1
157+
with:
158+
xcode-version: ${{ env.XCODE_VERSION }}
159+
160+
- name: Disable pasteboard sync
161+
run: defaults write com.apple.iphonesimulator PasteboardAutomaticSync -bool false
162+
163+
- name: Setup Node.js
164+
uses: actions/setup-node@v6
165+
with:
166+
node-version: ${{ env.NODE_VERSION }}
167+
168+
- name: Install Appium
169+
run: npm install -g appium
170+
171+
- name: Install ffmpeg
172+
run: brew install ffmpeg
173+
174+
- name: Install XCUITest driver
175+
run: appium driver install xcuitest
176+
177+
- name: Download prebuilt WDA
178+
run: npx appium driver run xcuitest download-wda-sim --platform=ios --outdir=${{ github.workspace }}/wda
179+
180+
- name: Setup iOS Simulator
181+
uses: futureware-tech/simulator-action@v4
182+
with:
183+
model: ${{ env.IOS_DEVICE_NAME }}
184+
os_version: ${{ env.IOS_VERSION }}
185+
wait_for_boot: true
186+
shutdown_after_job: false
187+
188+
- name: Restore dependencies
189+
run: dotnet restore Appium.Net.sln
190+
191+
- name: Build solution
192+
run: dotnet build Appium.Net.sln --configuration ${{ env.BUILD_CONFIGURATION }} --no-restore
193+
194+
- name: Create test environment file
195+
run: |
196+
cat > ./test/integration/env.json << 'EOF'
197+
{
198+
"DEV": "false",
199+
"isRemoteAppiumServer": "false",
200+
"remoteAppiumServerUri": "http://127.0.0.1:4723"
201+
}
202+
EOF
203+
204+
- name: Run iOS functional tests
205+
env:
206+
LOCAL_PREBUILT_WDA: ${{ github.workspace }}/wda/WebDriverAgentRunner-Runner.app
207+
run: |
208+
dotnet test --configuration ${{ env.BUILD_CONFIGURATION }} \
209+
--no-build \
210+
--framework net8.0 \
211+
--filter "FullyQualifiedName~IOS" \
212+
--logger "trx;LogFileName=ios-test-results.trx" \
213+
--logger "console;verbosity=detailed" \
214+
./test/integration/Appium.Net.Integration.Tests.csproj
215+
216+
- name: Publish test results
217+
uses: dorny/test-reporter@v2
218+
if: always()
219+
with:
220+
name: iOS Test Results
221+
path: '**/ios-test-results.trx'
222+
reporter: dotnet-trx
223+
224+
- name: Save server output
225+
if: always()
226+
uses: actions/upload-artifact@v6
227+
with:
228+
name: appium-ios.log
229+
path: |
230+
appium*.log
231+
*.log
232+
if-no-files-found: ignore

.github/workflows/unit-test.yml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: Unit Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- 'release/**'
8+
pull_request:
9+
branches:
10+
- main
11+
- 'release/**'
12+
13+
jobs:
14+
test:
15+
runs-on: ${{ matrix.os }}
16+
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
os: [windows-latest, ubuntu-latest, macos-latest]
21+
include:
22+
- os: windows-latest
23+
framework: 'net48|net8.0'
24+
- os: ubuntu-latest
25+
framework: 'net8.0'
26+
- os: macos-latest
27+
framework: 'net8.0'
28+
29+
env:
30+
SOLUTION: 'Appium.Net.sln'
31+
BUILD_PLATFORM: 'Any CPU'
32+
BUILD_CONFIGURATION: 'Release'
33+
34+
steps:
35+
- name: Checkout code
36+
uses: actions/checkout@v6
37+
38+
- name: Setup .NET
39+
uses: actions/setup-dotnet@v5
40+
with:
41+
dotnet-version: '8.0.x'
42+
43+
- name: Setup NuGet (Windows)
44+
if: runner.os == 'Windows'
45+
uses: NuGet/setup-nuget@v2
46+
47+
- name: Restore NuGet packages (Windows)
48+
if: runner.os == 'Windows'
49+
run: nuget restore ${{ env.SOLUTION }}
50+
51+
- name: Restore NuGet packages (Linux/macOS)
52+
if: runner.os != 'Windows'
53+
run: dotnet restore ${{ env.SOLUTION }}
54+
55+
- name: Setup MSBuild (Windows)
56+
if: runner.os == 'Windows'
57+
uses: microsoft/setup-msbuild@v2
58+
59+
- name: Build solution (Windows)
60+
if: runner.os == 'Windows'
61+
run: |
62+
msbuild ${{ env.SOLUTION }} `
63+
/p:DeployOnBuild=true `
64+
/p:WebPublishMethod=Package `
65+
/p:PackageAsSingleFile=true `
66+
/p:SkipInvalidConfigurations=true `
67+
/p:DesktopBuildPackageLocation="${{ runner.temp }}\WebApp.zip" `
68+
/p:DeployIisAppPath="Default Web Site" `
69+
/p:Configuration=${{ env.BUILD_CONFIGURATION }} `
70+
/p:Platform="${{ env.BUILD_PLATFORM }}" `
71+
/m
72+
73+
- name: Build solution (Linux/macOS)
74+
if: runner.os != 'Windows'
75+
run: dotnet build ${{ env.SOLUTION }} --configuration ${{ env.BUILD_CONFIGURATION }}
76+
77+
- name: Setup Node.js
78+
uses: actions/setup-node@v6
79+
with:
80+
node-version: 'lts/*'
81+
82+
- name: Install Appium
83+
run: npm install -g appium
84+
85+
- name: Run .NET Framework 4.8 unit tests
86+
if: runner.os == 'Windows'
87+
run: |
88+
dotnet test `
89+
--no-build `
90+
--configuration ${{ env.BUILD_CONFIGURATION }} `
91+
--filter "AppiumLocalServerLaunchingTest|DirectConnectTest|AppiumClientConfigTest" `
92+
--framework net48 `
93+
--logger "trx;LogFileName=test-results-net48.trx" `
94+
./test/integration/Appium.Net.Integration.Tests.csproj
95+
96+
- name: Run .NET 8 unit tests
97+
run: |
98+
dotnet test \
99+
--no-build \
100+
--configuration ${{ env.BUILD_CONFIGURATION }} \
101+
--filter "AppiumLocalServerLaunchingTest|DirectConnectTest|AppiumClientConfigTest" \
102+
--framework net8.0 \
103+
--logger "trx;LogFileName=test-results-net8-${{ matrix.os }}.trx" \
104+
./test/integration/Appium.Net.Integration.Tests.csproj
105+
shell: bash
106+
107+
- name: Publish test results
108+
uses: dorny/test-reporter@v2
109+
if: always()
110+
with:
111+
name: Test Results (${{ matrix.os }})
112+
path: '**/test-results-*.trx'
113+
reporter: dotnet-trx

0 commit comments

Comments
 (0)