-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
94 lines (91 loc) · 2.96 KB
/
dotnet-examples.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
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
name: Run DotNet examples
on:
schedule:
- cron: '35 22 * * *'
workflow_dispatch:
pull_request:
branches:
- trunk
paths:
- 'examples/dotnet/**'
push:
branches:
- trunk
paths:
- 'examples/dotnet/**'
env:
DISPLAY: :99
GITHUB_TOKEN: ${{ secrets.SELENIUM_CI_TOKEN }}
GH_TOKEN: ${{ secrets.SELENIUM_CI_TOKEN }}
jobs:
tests:
strategy:
fail-fast: false
matrix:
os: [ ubuntu, windows, macos ]
release: [ stable, nightly ]
runs-on: ${{ format('{0}-latest', matrix.os) }}
steps:
- name: Checkout GitHub repo
uses: actions/checkout@v4
- name: Remove driver directories Windows
if: matrix.os == 'windows'
run: |
rm "$env:ChromeWebDriver" -r -v
rm "$env:EdgeWebDriver" -r -v
rm "$env:GeckoWebDriver" -r -v
- name: Remove driver directories Non-Windows
if: matrix.os != 'windows'
run: |
sudo rm -rf $CHROMEWEBDRIVER $EDGEWEBDRIVER $GECKOWEBDRIVER
- name: Start Xvfb
if: matrix.os == 'ubuntu'
run: Xvfb :99 &
- name: Set up .Net Stable
if: matrix.release == 'stable'
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
- name: Set up .Net Nightly
if: matrix.release == 'nightly'
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
source-url: https://nuget.pkg.github.com/seleniumhq/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Update Nightly version non-Windows
if: matrix.release == 'nightly' && matrix.os != 'windows'
run:
|
pip install -r ./scripts/requirements.txt
latest_nightly=$(python ./scripts/latest-nightly-version.py nuget Selenium.WebDriver)
echo $latest_nightly
dotnet add examples/dotnet/SeleniumDocs/SeleniumDocs.csproj package Selenium.WebDriver --version $latest_nightly
dotnet add examples/dotnet/SeleniumDocs/SeleniumDocs.csproj package Selenium.Support --version $latest_nightly
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update Nightly version Windows
if: matrix.release == 'nightly' && matrix.os == 'windows'
shell: pwsh
run:
|
pip install -r ./scripts/requirements.txt
$latest_nightly = python ./scripts/latest-nightly-version.py nuget Selenium.WebDriver
dotnet add examples/dotnet/SeleniumDocs/SeleniumDocs.csproj package Selenium.WebDriver --version $latest_nightly
dotnet add examples/dotnet/SeleniumDocs/SeleniumDocs.csproj package Selenium.Support --version $latest_nightly
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 11
- name: Run tests
uses: nick-fields/[email protected]
with:
timeout_minutes: 20
max_attempts: 3
command: |
cd examples/dotnet/SeleniumDocs
dotnet test