Tests - Disable AppArmor #43
This file contains hidden or 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: | |
| push: | |
| branches: | |
| - main | |
| - release-* | |
| pull_request: | |
| branches: [ main ] | |
| paths: | |
| - '**.cs' | |
| - '**.csproj' | |
| env: | |
| DOTNET_VERSION: '6.0.x' # The .NET SDK version to use | |
| jobs: | |
| build: | |
| name: build-${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest] | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Setup .NET Core | |
| uses: actions/setup-dotnet@v1 | |
| with: | |
| dotnet-version: ${{ env.DOTNET_VERSION }} | |
| - name: Install dependencies | |
| run: | | |
| dotnet restore PuppeteerSharp.Dom.sln | |
| dotnet dev-certs https -ep PuppeteerSharp.Dom.TestServer/testCert.cer | |
| sudo openssl x509 -inform der -in PuppeteerSharp.Dom.TestServer/testCert.cer -out /usr/local/share/ca-certificates/testCert.crt -outform pem | |
| sudo update-ca-certificates | |
| - name: Build | |
| run: | | |
| echo "Buid version is 5.0.${{github.run_number}}" | |
| dotnet build PuppeteerSharp.Dom.sln /p:Version=5.0.${{github.run_number}} --configuration Release | |
| - name: Disable AppArmor | |
| if: matrix.os == 'ubuntu-latest' | |
| run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns | |
| - name: Test | |
| run: | | |
| Xvfb :1 -screen 5 1024x768x8 & | |
| export DISPLAY=:1.5 | |
| cd PuppeteerSharp.Dom.Tests | |
| dotnet test -f net6.0 -s test.runsettings -c Debug --logger "trx;LogFileName=TestResults.xml" | |
| - name: Publish Nuget packages | |
| run: | | |
| dotnet nuget push PuppeteerSharp.Dom/bin/Release/*.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/ChromiumDotNet/index.json | |
| dotnet nuget push PuppeteerSharp.Dom/bin/Release/*.nupkg -k ${{ secrets.PuppeteerSharpDom }} -s https://www.myget.org/F/cefsharp/api/v3/index.json |