Files
blog.stevanfreeborn.com/.github/workflows/pull_request.yml
T
2026-06-30 11:05:56 -05:00

64 lines
2.1 KiB
YAML

name: Pull Request
on:
pull_request:
branches:
- main
paths-ignore:
- '.github/**'
- '.vscode/**'
- '.gitignore'
- '.editorconfig'
- 'LICENSE.md'
- 'docker-compose.dev.yml'
- 'docker-compose.prod.yml'
- '**/*/README.md'
- '**/*/Dockerfile'
- 'scripts/**'
jobs:
run_tests:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Setup PowerShell (Ubuntu)
shell: bash
run: |
apt-get update
apt-get install -y wget apt-transport-https software-properties-common
wget -q "https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb"
dpkg -i packages-microsoft-prod.deb
apt-get update
apt-get install -y powershell
- name: Install report generator
run: |
dotnet tool install --tool-path ./.tools dotnet-reportgenerator-globaltool
echo "$PWD/.tools" >> "$GITHUB_PATH"
- name: Restore dependencies
run: dotnet restore
- name: Build project
run: dotnet build --no-restore
- name: Install playwright dependencies
shell: pwsh
run: ./test/Blog.Tests/bin/Debug/net10.0/playwright.ps1 install-deps
- name: Install playwright
shell: pwsh
run: ./test/Blog.Tests/bin/Debug/net10.0/playwright.ps1 install
- name: Test project
run: dotnet test -e DOTNET_ENVIRONMENT=CI --no-build --verbosity normal -s ./test/Blog.Tests/ci.runsettings
- name: Upload test results
uses: actions/upload-artifact@v3
with:
name: test-results
path: ./test/Blog.Tests/TestResults
- name: Upload playwright traces
if: always()
uses: actions/upload-artifact@v3
with:
name: playwright-traces
path: ./test/Blog.Tests/bin/Debug/net10.0/playwright-traces