Skip to content

build

build #735

Workflow file for this run

name: build
on:
workflow_dispatch:
push:
branches:
- master
- release-*
merge_group:
pull_request:
branches: [ master ]
paths:
- '**.yml'
- '**.cs'
- '**.csproj'
- '**.runsettings'
env:
DOTNET_VERSION: '7.0.x' # The .NET SDK version to use
jobs:
build:
name: build-${{ matrix.browser }}/${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
browser: [FIREFOX,CHROME]
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: Build
working-directory: lib
run: dotnet build PuppeteerSharp.sln
- name: Test (Linux)
if: matrix.os == 'ubuntu-latest'
env:
PRODUCT: ${{ matrix.browser }}
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"
- name: Test (Windows)
if: matrix.os == 'windows-latest'
env:
PRODUCT: ${{ matrix.browser }}
run: |
cd .\lib\PuppeteerSharp.Tests
dotnet test -s test.runsettings