Skip to content

Commit fa5b5a7

Browse files
authored
Nightly and Stable for JS and DotNet (#1682)
* Conditional for dotnet * Refactoring workflow * Using nightly for JS examples * Authenticating * Forcing overwrite * Using alias for nightly package.
1 parent 77eacb5 commit fa5b5a7

File tree

4 files changed

+57
-2
lines changed

4 files changed

+57
-2
lines changed

.github/workflows/dotnet-examples.yml

Lines changed: 11 additions & 2 deletions
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,7 +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'
49+
uses: actions/setup-dotnet@v4
50+
with:
51+
dotnet-version: 6.x
52+
- name: Set up .Net Nightly
53+
if: matrix.release == 'nightly'
4754
uses: actions/setup-dotnet@v4
4855
with:
4956
dotnet-version: 6.x
@@ -56,10 +63,12 @@ jobs:
5663
distribution: 'temurin'
5764
java-version: 11
5865
- name: Run tests
59-
uses: nick-invision/[email protected]
66+
uses: nick-fields/[email protected]
6067
with:
6168
timeout_minutes: 20
6269
max_attempts: 3
6370
command: |
6471
cd examples/dotnet/SeleniumDocs
6572
dotnet test
73+
env:
74+
SE_RELEASE: ${{ matrix.release }}

.github/workflows/js-examples.yml

Lines changed: 22 additions & 0 deletions
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
@@ -77,9 +78,30 @@ jobs:
7778
- name: Start Xvfb
7879
if: matrix.os == 'ubuntu-latest'
7980
run: Xvfb :99 &
81+
- name: Setup Node Stable
82+
if: matrix.release == 'stable'
83+
uses: actions/setup-node@v4
84+
with:
85+
node-version: '18.x'
86+
- name: Setup Node Nightly
87+
if: matrix.release == 'nightly'
88+
uses: actions/setup-node@v4
89+
with:
90+
node-version: '18.x'
91+
registry-url: 'https://npm.pkg.github.com'
92+
- name: Use Nightly package.json in Ubuntu/macOS
93+
if: matrix.release == 'nightly' && matrix.os != 'windows-latest'
94+
working-directory: ./examples/javascript
95+
run: mv package.nightly.json package.json
96+
- name: Use Nightly package.json in Windows
97+
if: matrix.release == 'nightly' && matrix.os == 'windows-latest'
98+
working-directory: ./examples/javascript
99+
run: Move-Item -Path package.nightly.json -Destination package.json -Force
80100
- name: Install Requirements
81101
working-directory: ./examples/javascript
82102
run: npm install
103+
env:
104+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83105
- name: Run tests
84106
uses: nick-invision/[email protected]
85107
with:

examples/dotnet/SeleniumDocs/SeleniumDocs.csproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,18 @@
1010
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="7.5.1" />
1111
<PackageReference Include="MSTest.TestAdapter" Version="3.3.1" />
1212
<PackageReference Include="MSTest.TestFramework" Version="3.3.1" />
13+
</ItemGroup>
14+
15+
<ItemGroup Label="Nightly" Condition=" '$(SE_RELEASE)' == 'nightly' ">
1316
<PackageReference Include="Selenium.Support" Version="4.20.0-nightly202404181318" />
1417
<PackageReference Include="Selenium.WebDriver" Version="4.20.0-nightly202404181318" />
1518
</ItemGroup>
1619

20+
<ItemGroup Label="Stable" Condition=" '$(SE_RELEASE)' == 'stable' ">
21+
<PackageReference Include="Selenium.Support" Version="4.19.0" />
22+
<PackageReference Include="Selenium.WebDriver" Version="4.19.0" />
23+
</ItemGroup>
24+
1725
<ItemGroup>
1826
<Folder Include="LocalPackages" />
1927
</ItemGroup>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "javascript-examples",
3+
"version": "1.0.0",
4+
"scripts": {
5+
"test": "npx mocha test/**/*.spec.js --timeout 60000"
6+
},
7+
"author": "The Selenium project",
8+
"license": "Apache-2.0",
9+
"dependencies": {
10+
"assert": "2.1.0",
11+
"selenium-webdriver": "npm:@seleniumhq/[email protected]"
12+
},
13+
"devDependencies": {
14+
"mocha": "10.4.0"
15+
}
16+
}

0 commit comments

Comments
 (0)