Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
57 lines
1.5 KiB
YAML
57 lines
1.5 KiB
YAML
name: Tests
|
|
permissions:
|
|
contents: read
|
|
|
|
on: [pull_request, workflow_dispatch]
|
|
|
|
jobs:
|
|
unit_tests:
|
|
name: Unit tests
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
|
|
steps:
|
|
- name: Set up .NET
|
|
uses: actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: 8.x
|
|
|
|
- name: Checkout source
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Restore NuGet dependencies
|
|
run: dotnet restore Duplicati.sln
|
|
|
|
- name: Build Duplicati
|
|
run: dotnet build --no-restore Duplicati.sln
|
|
|
|
- name: Run unit tests
|
|
run: dotnet test --no-build --verbosity minimal Duplicati.sln
|
|
|
|
playwright_tests:
|
|
name: Playwright UI tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: 8.x
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
- uses: actions/checkout@v4
|
|
- name: Install NPM dependencies
|
|
run: npm ci
|
|
- name: Install Playwright browsers
|
|
run: npx playwright install --with-deps
|
|
- name: Publish Duplicati server
|
|
run: dotnet publish -o published Duplicati.sln
|
|
- name: Start server
|
|
run: |
|
|
./published/Duplicati.Server --webservice-password=easy1234 &
|
|
timeout 30 bash -c 'until printf "" 2>>/dev/null >>/dev/tcp/127.0.0.1/8200; do sleep 1; echo waiting; done'
|
|
- name: Run Playwright tests
|
|
run: npx playwright test
|