Update upstream expectations #1695
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
- release-* | |
merge_group: | |
pull_request: | |
paths: | |
- '**.yml' | |
- '**.cs' | |
- '**.json' | |
- '**.csproj' | |
- '**.runsettings' | |
env: | |
DOTNET_VERSION: '8.0.x' # The .NET SDK version to use | |
jobs: | |
build: | |
name: ${{ matrix.browser }}-${{ matrix.mode }}-${{ matrix.os }}-${{ matrix.protocol }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-latest | |
browser: CHROME | |
mode: headless | |
protocol: cdp | |
- os: ubuntu-latest | |
browser: CHROME | |
mode: headful | |
protocol: cdp | |
- os: ubuntu-latest | |
browser: CHROME | |
mode: headless-shell | |
protocol: cdp | |
- os: windows-latest | |
browser: CHROME | |
mode: headless | |
protocol: cdp | |
- os: windows-latest | |
browser: CHROME | |
mode: headful | |
protocol: cdp | |
- os: windows-latest | |
browser: CHROME | |
mode: headless-shell | |
protocol: cdp | |
- os: ubuntu-latest | |
browser: FIREFOX | |
mode: headless | |
protocol: webdriverbidi | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: ${{ env.DOTNET_VERSION }} | |
- name: Restore (Windows) | |
if: matrix.os == 'windows-latest' | |
run: | | |
choco install docfx | |
- name: Restore | |
working-directory: lib | |
run: | | |
dotnet restore PuppeteerSharp.sln | |
- name: Install dependencies (Linux) | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
dotnet dev-certs https --clean | |
dotnet dev-certs https -ep lib/PuppeteerSharp.TestServer/testCert.cer | |
sudo openssl x509 -inform der -in lib/PuppeteerSharp.TestServer/testCert.cer -out /usr/local/share/ca-certificates/testCert.crt -outform pem | |
sudo update-ca-certificates | |
- name: Install dependencies (Windows) | |
if: matrix.os == 'windows-latest' | |
run: | | |
New-SelfSignedCertificate -Subject "localhost" -FriendlyName "Puppeteer" -CertStoreLocation "cert:\CurrentUser\My" | |
Get-ChildItem -Path cert:\CurrentUSer\my | where { $_.friendlyname -eq "Puppeteer" } | Export-Certificate -FilePath $env:GITHUB_WORKSPACE\lib\PuppeteerSharp.TestServer\testCert.cer | |
- name: Check formatting | |
if: ${{ matrix.os == 'ubuntu-latest' && matrix.browser == 'CHROME' && matrix.mode == 'headless' && matrix.protocol == 'cdp' }} | |
run: dotnet format ./lib/PuppeteerSharp.sln --verify-no-changes --exclude-diagnostics CA1865 | |
- name: Build | |
working-directory: lib | |
run: dotnet build PuppeteerSharp.sln | |
- name: Disable AppArmor | |
if: matrix.os == 'ubuntu-latest' | |
run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns | |
- name: Test (Linux) | |
if: matrix.os == 'ubuntu-latest' | |
env: | |
BROWSER: ${{ matrix.browser }} | |
HEADLESS_MODE: ${{ matrix.mode }} | |
PROTOCOL: ${{ matrix.protocol }} | |
run: | | |
Xvfb :1 -screen 5 1024x768x8 & | |
export DISPLAY=:1.5 | |
cd lib/PuppeteerSharp.Tests | |
dotnet test -s test.runsettings -c Debug --logger "trx;LogFileName=TestResults.xml" --blame-hang-timeout 300000 | |
- name: Test (Windows) | |
if: matrix.os == 'windows-latest' | |
env: | |
BROWSER: ${{ matrix.browser }} | |
HEADLESS_MODE: ${{ matrix.mode }} | |
PROTOCOL: ${{ matrix.protocol }} | |
run: | | |
cd .\lib\PuppeteerSharp.Tests | |
dotnet test -s test.runsettings --blame-hang-timeout 300000 | |