Skip to content

Commit 2bd6a3c

Browse files
committed
Refactoring workflow
1 parent d2c6d0f commit 2bd6a3c

File tree

2 files changed

+9
-42
lines changed

2 files changed

+9
-42
lines changed

.github/workflows/dotnet-examples.yml

+7-40
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
fail-fast: false
2727
matrix:
2828
os: [ ubuntu-latest, windows-latest, macos-latest ]
29+
release: [ stable, nightly ]
2930
runs-on: ${{ matrix.os }}
3031
steps:
3132
- name: Checkout GitHub repo
@@ -43,49 +44,13 @@ jobs:
4344
- name: Start Xvfb
4445
if: matrix.os == 'ubuntu-latest'
4546
run: Xvfb :99 &
46-
- name: Set up .Net
47+
- name: Set up .Net Stable
48+
if: matrix.release == 'stable'
4749
uses: actions/setup-dotnet@v4
4850
with:
4951
dotnet-version: 6.x
50-
- name: Set up Java
51-
uses: actions/setup-java@v4
52-
with:
53-
distribution: 'temurin'
54-
java-version: 11
55-
- name: Run tests
56-
uses: nick-invision/[email protected]
57-
with:
58-
timeout_minutes: 20
59-
max_attempts: 3
60-
command: |
61-
cd examples/dotnet/SeleniumDocs
62-
dotnet test
63-
64-
test_examples_nightly:
65-
strategy:
66-
fail-fast: false
67-
matrix:
68-
os: [ ubuntu-latest, windows-latest, macos-latest ]
69-
runs-on: ${{ matrix.os }}
70-
env:
71-
SE_NIGHTLY: true
72-
steps:
73-
- name: Checkout GitHub repo
74-
uses: actions/checkout@v4
75-
- name: Remove driver directories Windows
76-
if: matrix.os == 'windows-latest'
77-
run: |
78-
rm "$env:ChromeWebDriver" -r -v
79-
rm "$env:EdgeWebDriver" -r -v
80-
rm "$env:GeckoWebDriver" -r -v
81-
- name: Remove driver directories Non-Windows
82-
if: matrix.os != 'windows-latest'
83-
run: |
84-
sudo rm -rf $CHROMEWEBDRIVER $EDGEWEBDRIVER $GECKOWEBDRIVER
85-
- name: Start Xvfb
86-
if: matrix.os == 'ubuntu-latest'
87-
run: Xvfb :99 &
88-
- name: Set up .Net
52+
- name: Set up .Net Nightly
53+
if: matrix.release == 'nightly'
8954
uses: actions/setup-dotnet@v4
9055
with:
9156
dotnet-version: 6.x
@@ -105,3 +70,5 @@ jobs:
10570
command: |
10671
cd examples/dotnet/SeleniumDocs
10772
dotnet test
73+
env:
74+
SE_RELEASE: ${{ matrix.release }}

examples/dotnet/SeleniumDocs/SeleniumDocs.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
<PackageReference Include="MSTest.TestFramework" Version="3.3.1" />
1313
</ItemGroup>
1414

15-
<ItemGroup Label="" Condition=" '$(SE_NIGHTLY)' != '' ">
15+
<ItemGroup Label="Nightly" Condition=" '$(SE_RELEASE)' == 'nightly' ">
1616
<PackageReference Include="Selenium.Support" Version="4.20.0-nightly202404181318" />
1717
<PackageReference Include="Selenium.WebDriver" Version="4.20.0-nightly202404181318" />
1818
</ItemGroup>
1919

20-
<ItemGroup Label="" Condition=" '$(SE_NIGHTLY)' == '' ">
20+
<ItemGroup Label="Stable" Condition=" '$(SE_RELEASE)' == 'stable' ">
2121
<PackageReference Include="Selenium.Support" Version="4.19.0" />
2222
<PackageReference Include="Selenium.WebDriver" Version="4.19.0" />
2323
</ItemGroup>

0 commit comments

Comments
 (0)