Bumps the CI actions to their latest majors to clear the recurring "Node.js 20 is deprecated" warnings (the pinned actions bundled Node 20, which GitHub is retiring on runners): - actions/checkout v4 -> v7 - actions/setup-dotnet v4 -> v5 - actions/upload-artifact v4 -> v7 - actions/setup-node v4 -> v6 - actions/stale v9 -> v10 atomicjar/testcontainers-cloud-setup-action is already on the latest major (v1). Only the action version tags change. All bumped majors run on Node.js 24 and require Actions Runner >= v2.327.1, which the GitHub-hosted runners used here always satisfy. checkout v7's fork-PR checkout block only applies to pull_request_target/workflow_run (not used here), and setup-node's auto-cache only triggers with a packageManager field in package.json (not present), so behavior is unchanged. Validated with actionlint. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
131 lines
4.1 KiB
YAML
131 lines
4.1 KiB
YAML
name: Tests
|
|
permissions:
|
|
contents: read
|
|
issues: none
|
|
pull-requests: none
|
|
|
|
on: [pull_request, workflow_dispatch]
|
|
|
|
jobs:
|
|
unit_tests:
|
|
name: Unit tests
|
|
runs-on: ${{ matrix.os }}
|
|
env:
|
|
DUPLICATI__AES_V3_ITERATIONS: 10000
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
|
|
steps:
|
|
- name: Set up .NET
|
|
uses: actions/setup-dotnet@v5
|
|
with:
|
|
dotnet-version: 10.x
|
|
|
|
- name: Checkout source
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Restore NuGet dependencies
|
|
run: dotnet restore Duplicati.slnx
|
|
|
|
- name: Build Duplicati
|
|
run: dotnet build --no-restore Duplicati.slnx
|
|
|
|
- name: Run unit tests with coverage
|
|
run: |
|
|
mkdir -p "$GITHUB_WORKSPACE/TestResults/unit"
|
|
dotnet test --no-build --verbosity minimal --filter "Category!=Integration&Category!=DiskImageLocal&Category!=ExcludedFromCLI&ClassName!~SecretProviderSetSecretTests" --collect:"XPlat Code Coverage" --results-directory "$GITHUB_WORKSPACE/TestResults/unit" Duplicati.slnx
|
|
|
|
integration_tests:
|
|
name: Integration tests
|
|
runs-on: ${{ matrix.os }}
|
|
env:
|
|
DUPLICATI__AES_V3_ITERATIONS: 10000
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
|
|
steps:
|
|
- name: Set up .NET
|
|
uses: actions/setup-dotnet@v5
|
|
with:
|
|
dotnet-version: 10.x
|
|
|
|
- name: Checkout source
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Restore NuGet dependencies
|
|
run: dotnet restore Duplicati.slnx
|
|
|
|
- name: Build Duplicati
|
|
run: dotnet build --no-restore Duplicati.slnx
|
|
|
|
- name: Run integration tests with coverage
|
|
run: |
|
|
mkdir -p "$GITHUB_WORKSPACE/TestResults/integration"
|
|
dotnet test --no-build --verbosity minimal --filter "Category=Integration" --collect:"XPlat Code Coverage" --results-directory "$GITHUB_WORKSPACE/TestResults/integration" Duplicati.slnx
|
|
|
|
playwright_tests:
|
|
name: Playwright UI tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/setup-dotnet@v5
|
|
with:
|
|
dotnet-version: 10.x
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 20
|
|
- uses: actions/checkout@v7
|
|
- name: Install NPM dependencies
|
|
run: npm ci
|
|
- name: Install Playwright browsers
|
|
run: npx playwright install --with-deps
|
|
- name: Publish Duplicati server
|
|
run: dotnet publish -c Debug -o published Duplicati.slnx
|
|
- name: Start server
|
|
run: |
|
|
./published/Duplicati.Server --disable-db-encryption --webservice-password=easy1234 --webservice-suppress-welcome-page > server.log 2>&1 &
|
|
SERVER_PID=$!
|
|
echo "SERVER_PID=$SERVER_PID" >> $GITHUB_ENV
|
|
timeout 30 bash -c 'until printf "" 2>>/dev/null >>/dev/tcp/127.0.0.1/8200; do sleep 1; echo waiting; done'
|
|
echo "Server started with PID: $SERVER_PID"
|
|
- name: Load web UI
|
|
run: |
|
|
curl -f http://localhost:8200/ngclient/index.html
|
|
echo "Web UI loaded successfully"
|
|
- name: Check server status
|
|
run: |
|
|
echo "Server process status:"
|
|
ps aux | grep Duplicati.Server || true
|
|
echo "Server log (last 50 lines):"
|
|
tail -n 50 server.log || true
|
|
- name: Run Playwright tests
|
|
run: npx playwright test --reporter=list,html,github
|
|
|
|
- name: Capture server logs on failure
|
|
if: failure()
|
|
run: |
|
|
echo "=== Full Server Log ==="
|
|
cat server.log || echo "No server log found"
|
|
|
|
- name: Upload Playwright test results on failure
|
|
if: failure()
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: playwright-test-results
|
|
path: |
|
|
test-results/
|
|
playwright-report/
|
|
server.log
|
|
retention-days: 7
|
|
|
|
- name: Upload Playwright HTML report
|
|
if: always()
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: playwright-html-report
|
|
path: playwright-report/
|
|
retention-days: 7
|