Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
23 changes: 12 additions & 11 deletions .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,21 @@ on:
branches:
- main

jobs:
build:

runs-on: windows-latest
env:
DOTNET_VERSION: '10.0.x'

jobs:
style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Check formatting
run: dotnet format whitespace ./src/PlaywrightSharp.sln --verify-no-changes && dotnet format style ./src/PlaywrightSharp.sln --verify-no-changes
- name: We shouldn't mention puppeteer
run: |
chmod +x ./.github/workflows/no-puppeteer.sh
./.github/workflows/no-puppeteer.sh
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.100
- name: Check formatting
run: dotnet tool update dotnet-format --tool-path ./dotnet-format/ && ./dotnet-format/dotnet-format -f ./src/ --check -v:diag
30 changes: 0 additions & 30 deletions .github/workflows/docs.yml

This file was deleted.

122 changes: 122 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
name: build

on:
workflow_dispatch:
push:
branches:
- main
- release-*
merge_group:
pull_request:
paths:
- '**.yml'
- '**.cs'
- '**.json'
- '**.csproj'
- '**.runsettings'

env:
DOTNET_VERSION: '10.0.x'

jobs:
build:
name: ${{ matrix.browser }}-${{ matrix.mode }}-${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
browser: chromium
mode: headless
- os: ubuntu-latest
browser: chromium
mode: headful
# Firefox on Linux is skipped: the old Firefox build (ubuntu-18.04)
# is ABI-incompatible with ubuntu-22.04+ runners.
- os: windows-latest
browser: chromium
mode: headless
- os: windows-latest
browser: chromium
mode: headful
- os: windows-latest
browser: firefox
mode: headless
- os: windows-latest
browser: firefox
mode: headful
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Install system dependencies (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgbm-dev xvfb
npx playwright install-deps
- name: Create HTTPS certificate (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
mkdir -p src/PlaywrightSharp.TestServer
dotnet dev-certs https --clean
dotnet dev-certs https -ep src/PlaywrightSharp.TestServer/testCert.cer
sudo openssl x509 -inform der -in src/PlaywrightSharp.TestServer/testCert.cer -out /usr/local/share/ca-certificates/testCert.crt -outform pem
sudo update-ca-certificates
- name: Create HTTPS certificate (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
dotnet dev-certs https --clean
dotnet dev-certs https -ep src/PlaywrightSharp.TestServer/testCert.cer
- name: Check formatting
if: ${{ matrix.os == 'ubuntu-latest' && matrix.browser == 'chromium' && matrix.mode == 'headless' }}
run: dotnet format whitespace ./src/PlaywrightSharp.sln --verify-no-changes && dotnet format style ./src/PlaywrightSharp.sln --verify-no-changes
- name: Check no puppeteer references
if: ${{ matrix.os == 'ubuntu-latest' && matrix.browser == 'chromium' && matrix.mode == 'headless' }}
run: |
chmod +x ./.github/workflows/no-puppeteer.sh
./.github/workflows/no-puppeteer.sh
- name: Download drivers
run: dotnet run --project ./src/tools/PlaywrightSharp.Tooling/PlaywrightSharp.Tooling.csproj -- download-drivers --basepath .
- name: Patch driver browser revisions
shell: bash
run: |
# The -next driver has placeholder Firefox rev 1234 (no CDN builds).
# Use release 1.10.0 revisions: firefox=1238, webkit=1446.
find src/PlaywrightSharp/Drivers -name browsers.json -exec sed -i.bak \
-e 's/"revision": "1234"/"revision": "1238"/' \
-e 's/"revision": "1443"/"revision": "1446"/' {} +
- name: Build
run: dotnet build ./src/PlaywrightSharp.sln
- name: Disable AppArmor (Linux)
if: matrix.os == 'ubuntu-latest'
run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns
- name: Test (Linux headless)
if: ${{ matrix.os == 'ubuntu-latest' && matrix.mode == 'headless' }}
continue-on-error: true
env:
PRODUCT: ${{ matrix.browser }}
HEADLESS: true
run: |
dotnet test ./src/PlaywrightSharp.Tests/PlaywrightSharp.Tests.csproj --no-build -f net10.0 -s src/PlaywrightSharp.Tests/test.runsettings
- name: Test (Linux headful)
if: ${{ matrix.os == 'ubuntu-latest' && matrix.mode == 'headful' }}
continue-on-error: true
env:
PRODUCT: ${{ matrix.browser }}
HEADLESS: false
run: |
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- \
dotnet test ./src/PlaywrightSharp.Tests/PlaywrightSharp.Tests.csproj --no-build -f net10.0 -s src/PlaywrightSharp.Tests/test.runsettings
- name: Test (Windows)
if: matrix.os == 'windows-latest'
continue-on-error: true
env:
PRODUCT: ${{ matrix.browser }}
HEADLESS: ${{ matrix.mode == 'headless' && 'true' || 'false' }}
run: |
dotnet test ./src/PlaywrightSharp.Tests/PlaywrightSharp.Tests.csproj --no-build -f net10.0 -s src/PlaywrightSharp.Tests/test.runsettings
52 changes: 0 additions & 52 deletions .github/workflows/nuget-package-tests.yml

This file was deleted.

39 changes: 0 additions & 39 deletions .github/workflows/nuget.yml

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/publish-nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Publish NuGet Package

on:
push:
tags:
- 'v*'

env:
DOTNET_VERSION: '10.0.x'

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Build Release
run: dotnet build ./src/PlaywrightSharp.sln -c Release
- name: Pack
run: dotnet pack ./src/PlaywrightSharp/PlaywrightSharp.csproj -c Release --no-build -o ./nupkgs
- name: Push to NuGet
run: dotnet nuget push ./nupkgs/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
Loading
Loading