Skip to content

Commit 929d1a6

Browse files
authored
Migrate to github actions (#2282)
* Migrate to github actions * Add yml files to the build listener * some fixes * Workspace has the repo name * fix env variables in powershell * test docfx updates * rename title * improve docfx * fix typo * Do it manually * restore and remove fixed version * remove old action * Remove restore * build with 7? * use windows * retrigger * add permissions * fix artifact path * check output * Some tweaks * use v3 * v2 for uploads * ok is all v2 * add id * add setup pages * Make a class name more generic * Dispose browser * Improve disposables * Artifacts and fixed version * Remove appveyour builds * Push docs on tag * remove publish docs from the dotnet build * Chrome only test * this should be an or
1 parent ff099b8 commit 929d1a6

22 files changed

+106
-567
lines changed

.github/workflows/dotnet.yml

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
pull_request:
1010
branches: [ master ]
1111
paths:
12+
- '**.yml'
1213
- '**.cs'
1314
- '**.csproj'
1415

@@ -22,28 +23,49 @@ jobs:
2223
strategy:
2324
fail-fast: false
2425
matrix:
25-
os: [ubuntu-latest]
26+
os: [ubuntu-latest, windows-latest]
2627
browser: [FIREFOX,CHROME]
2728
steps:
2829
- uses: actions/checkout@v3
2930
- name: Setup .NET Core
3031
uses: actions/setup-dotnet@v3
3132
with:
3233
dotnet-version: ${{ env.DOTNET_VERSION }}
33-
34-
- name: Install dependencies
34+
- name: Restore (Windows)
35+
if: matrix.os == 'windows-latest'
36+
run: |
37+
choco install docfx
38+
- name: Restore
39+
working-directory: lib
40+
run: |
41+
dotnet restore PuppeteerSharp.sln
42+
- name: Install dependencies (Linux)
43+
if: matrix.os == 'ubuntu-latest'
3544
run: |
36-
dotnet restore lib/PuppeteerSharp.sln
3745
dotnet dev-certs https -ep lib/PuppeteerSharp.TestServer/testCert.cer
3846
sudo openssl x509 -inform der -in lib/PuppeteerSharp.TestServer/testCert.cer -out /usr/local/share/ca-certificates/testCert.crt -outform pem
3947
sudo update-ca-certificates
48+
- name: Install dependencies (Windows)
49+
if: matrix.os == 'windows-latest'
50+
run: |
51+
New-SelfSignedCertificate -Subject "localhost" -FriendlyName "Puppeteer" -CertStoreLocation "cert:\CurrentUser\My"
52+
Get-ChildItem -Path cert:\CurrentUSer\my | where { $_.friendlyname -eq "Puppeteer" } | Export-Certificate -FilePath $env:GITHUB_WORKSPACE\lib\PuppeteerSharp.TestServer\testCert.cer
4053
- name: Build
41-
run: dotnet build lib/PuppeteerSharp.sln
42-
- name: Test
54+
working-directory: lib
55+
run: dotnet build PuppeteerSharp.sln
56+
- name: Test (Linux)
57+
if: matrix.os == 'ubuntu-latest'
4358
env:
4459
PRODUCT: ${{ matrix.browser }}
4560
run: |
4661
Xvfb :1 -screen 5 1024x768x8 &
4762
export DISPLAY=:1.5
4863
cd lib/PuppeteerSharp.Tests
4964
dotnet test -f net6.0 -s test.runsettings -c Debug --logger "trx;LogFileName=TestResults.xml"
65+
- name: Test (Windows)
66+
if: matrix.os == 'windows-latest'
67+
env:
68+
PRODUCT: ${{ matrix.browser }}
69+
run: |
70+
cd .\lib\PuppeteerSharp.Tests
71+
dotnet test -f net6.0 -s test.runsettings

.github/workflows/publish-docs.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Publish docs
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
jobs:
14+
build:
15+
16+
name: Publish docs
17+
runs-on: windows-latest
18+
env:
19+
DOTNET_VERSION: '7.0.x' # The .NET SDK version to use
20+
21+
steps:
22+
- uses: actions/checkout@v3
23+
- name: Setup .NET Core
24+
uses: actions/setup-dotnet@v3
25+
with:
26+
dotnet-version: ${{ env.DOTNET_VERSION }}
27+
- name: Build
28+
run: |
29+
dotnet tool install --global docfx --version 2.60.2
30+
31+
docfx metadata docfx_project\docfx.json
32+
docfx build docfx_project\docfx.json -o docs
33+
- name: Setup Pages
34+
uses: actions/configure-pages@v3
35+
- name: Upload artifact
36+
uses: actions/upload-pages-artifact@v2
37+
with:
38+
path: 'docs'
39+
- name: Publish Documentation on GitHub Pages
40+
uses: actions/deploy-pages@v2
41+
id: deployment
42+
- name: Upload Site to artifact
43+
uses: actions/upload-artifact@v3
44+
with:
45+
name: 'Website'
46+
path: docs/
47+
retention-days: 1
48+
if-no-files-found: ignore
49+
if: always()
50+
continue-on-error: true

appveyor-demo.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

appveyor-edge.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

appveyor-fullframework.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

appveyor-linux.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

appveyor.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

appveyor/GenerateDocs.ps1

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)