Skip to content

Infra: Add CI/CD GitHub Actions workflows (modeled after puppeteer-sharp) #70

@kblok

Description

@kblok

Description

Add GitHub Actions CI/CD workflows to PlaywrightSharp, modeled after puppeteer-sharp's pipeline.

What to Implement

Main test workflow (.github/workflows/dotnet.yml)

  • Triggers: workflow_dispatch, push to main/release-*, PRs
  • File filters: Only trigger on .yml, .cs, .json, .csproj, .runsettings changes
  • .NET SDK: 10.0.x
  • Matrix strategy:
    • OS: Ubuntu and Windows
    • Browsers: Chromium, Firefox (WebKit when ready)
    • Modes: headless, headful
  • Steps:
    1. Checkout
    2. Setup .NET 10 SDK
    3. Install system dependencies (libgbm-dev, xvfb on Linux)
    4. Generate HTTPS dev certificate (dotnet dev-certs https -ep src/PlaywrightSharp.TestServer/testCert.cer)
    5. Code formatting check (dotnet format) — only on first matrix combo
    6. Puppeteer reference check (no "puppeteer" in code)
    7. Build solution
    8. Run tests with PRODUCT env var and --filter Category= flag
    9. Use xvfb-run on Linux for headful tests
  • Test retry: Consider adding dotnet-retest for flaky browser test handling
  • Timeout: TestSessionTimeout of 3600000ms via .runsettings

Code style workflow (.github/workflows/code-style.yml)

  • Runs dotnet format --check
  • Checks for "puppeteer" references in the codebase

NuGet publish workflow (.github/workflows/publish-nuget.yml)

  • Triggers on version tags
  • Publishes packages to nuget.org

Upstream References

  • puppeteer-sharp .github/workflows/dotnet.yml
  • puppeteer-sharp .github/workflows/code-style.yml
  • puppeteer-sharp .github/workflows/PushNugetPackageToNugetOrg.yml

Files to Create/Modify

  • .github/workflows/dotnet.yml (new)
  • .github/workflows/code-style.yml (new)
  • .github/workflows/publish-nuget.yml (new)
  • src/PlaywrightSharp.Tests/test.runsettings (new)

Verification

Push a branch and verify workflows trigger and execute correctly.

Dependencies

Depends on: #1

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-parityIssues tracking feature parity with upstream Playwrightphase-1Phase 1: Infrastructure

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions