Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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.

142 changes: 142 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
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
- os: ubuntu-latest
browser: firefox
mode: headless
- os: ubuntu-latest
browser: firefox
mode: headful
- 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
- 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: Build
run: dotnet build ./src/PlaywrightSharp.sln -p:PlaywrightSkipBrowserInstall=true
- name: Install browsers (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
CDN="https://playwright.azureedge.net/builds"
BROWSERS_DIR="$HOME/.cache/ms-playwright"
mkdir -p "$BROWSERS_DIR"
if [ "${{ matrix.browser }}" = "chromium" ]; then
curl -sL "$CDN/chromium/857950/chromium-linux.zip" -o /tmp/chromium.zip
unzip -q /tmp/chromium.zip -d "$BROWSERS_DIR/chromium-857950"
elif [ "${{ matrix.browser }}" = "firefox" ]; then
curl -sL "$CDN/firefox/1234/firefox-linux.zip" -o /tmp/firefox.zip
unzip -q /tmp/firefox.zip -d "$BROWSERS_DIR/firefox-1234"
fi
ls -laR "$BROWSERS_DIR/" | head -30
- name: Install browsers (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
$cdn = "https://playwright.azureedge.net/builds"
$browsersDir = "$env:LOCALAPPDATA\ms-playwright"
New-Item -ItemType Directory -Force -Path $browsersDir | Out-Null
if ("${{ matrix.browser }}" -eq "chromium") {
Invoke-WebRequest -Uri "$cdn/chromium/857950/chromium-win64.zip" -OutFile "$env:TEMP\chromium.zip"
Expand-Archive -Path "$env:TEMP\chromium.zip" -DestinationPath "$browsersDir\chromium-857950"
} elseif ("${{ matrix.browser }}" -eq "firefox") {
Invoke-WebRequest -Uri "$cdn/firefox/1234/firefox-win64.zip" -OutFile "$env:TEMP\firefox.zip"
Expand-Archive -Path "$env:TEMP\firefox.zip" -DestinationPath "$browsersDir\firefox-1234"
}
- 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' }}
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' }}
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'
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