Skip to content
Closed
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 19 additions & 14 deletions .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
name: Code Style Checks

on:
workflow_dispatch:
push:
branches:
- main
- release-*
pull_request:
branches:
- main
paths:
- '**.cs'
- '**.csproj'
- '**.sln'

jobs:
build:

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

jobs:
code-style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: We shouldn't mention puppeteer
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Check formatting
run: dotnet format ./src/PlaywrightSharp.sln --verify-no-changes
- name: Check for puppeteer references
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
106 changes: 106 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
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: windows-latest
browser: chromium
mode: headless
- os: windows-latest
browser: chromium
mode: headful
- os: ubuntu-latest
browser: firefox
mode: headless
- os: ubuntu-latest
browser: firefox
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: Generate HTTPS dev certificate (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
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: Generate HTTPS dev certificate (Windows)
if: matrix.os == 'windows-latest'
run: |
New-SelfSignedCertificate -Subject "localhost" -FriendlyName "PlaywrightSharp" -CertStoreLocation "cert:\CurrentUser\My"
Get-ChildItem -Path cert:\CurrentUser\my | where { $_.friendlyname -eq "PlaywrightSharp" } | Export-Certificate -FilePath $env:GITHUB_WORKSPACE\src\PlaywrightSharp.TestServer\testCert.cer
- name: Check formatting
if: ${{ matrix.os == 'ubuntu-latest' && matrix.browser == 'chromium' && matrix.mode == 'headless' }}
run: dotnet format ./src/PlaywrightSharp.sln --verify-no-changes
- name: Check for 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: Build
run: dotnet build ./src/PlaywrightSharp.sln
- name: Test (Linux headless)
if: ${{ matrix.os == 'ubuntu-latest' && matrix.mode == 'headless' }}
env:
PRODUCT: ${{ matrix.browser == 'chromium' && 'CHROMIUM' || 'FIREFOX' }}
HEADLESS: true
run: |
dotnet test ./src/PlaywrightSharp.Tests/PlaywrightSharp.Tests.csproj --filter Category=${{ matrix.browser }} -c Debug -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 == 'chromium' && 'CHROMIUM' || 'FIREFOX' }}
HEADLESS: false
run: |
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- dotnet test ./src/PlaywrightSharp.Tests/PlaywrightSharp.Tests.csproj --filter Category=${{ matrix.browser }} -c Debug -f net10.0 -s src/PlaywrightSharp.Tests/test.runsettings
- name: Test (Windows)
if: matrix.os == 'windows-latest'
env:
PRODUCT: ${{ matrix.browser == 'chromium' && 'CHROMIUM' || 'FIREFOX' }}
HEADLESS: ${{ matrix.mode == 'headless' && 'true' || 'false' }}
run: |
dotnet test ./src/PlaywrightSharp.Tests/PlaywrightSharp.Tests.csproj --filter Category=${{ matrix.browser }} -c Debug -f net10.0 -s src/PlaywrightSharp.Tests/test.runsettings
33 changes: 33 additions & 0 deletions .github/workflows/publish-nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: PushToNugetOrg

on:
workflow_dispatch:
push:
tags:
- v*

env:
DOTNET_VERSION: '10.0.x'

jobs:
PushToNugetOrg:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Install dependencies
run: |
dotnet restore ./src/PlaywrightSharp.sln
dotnet dev-certs https -ep src/PlaywrightSharp.TestServer/testCert.cer
- name: Build
run: |
dotnet build ./src/PlaywrightSharp.sln --configuration Release --no-restore
- name: NugetPush to nuget.org
env:
NUGET_TOKEN_EXISTS: ${{ secrets.NUGET_API_KEY }}
if: env.NUGET_TOKEN_EXISTS != ''
run: |
dotnet nuget push ./src/PlaywrightSharp/bin/Release/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
7 changes: 7 additions & 0 deletions src/PlaywrightSharp.Tests/test.runsettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<RunSettings>
<!-- Configurations that affect the Test Framework -->
<RunConfiguration>
<TestSessionTimeout>3600000</TestSessionTimeout>
</RunConfiguration>
</RunSettings>
Loading