100 lines
2.7 KiB
YAML
100 lines
2.7 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 }}
|
|
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 with coverage
|
|
run: |
|
|
mkdir -p "$GITHUB_WORKSPACE/TestResults/unit"
|
|
dotnet test --no-build --verbosity minimal \
|
|
--filter "Category!=Integration" \
|
|
--collect:"XPlat Code Coverage" \
|
|
--results-directory "$GITHUB_WORKSPACE/TestResults/unit" \
|
|
Duplicati.sln
|
|
|
|
- name: Upload unit test coverage
|
|
if: ${{ always() }}
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: unit-test-coverage-${{ runner.os }}
|
|
path: TestResults/unit/**
|
|
|
|
integration_tests:
|
|
name: Integration 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 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.sln
|
|
|
|
- name: Upload coverage reports to Codecov
|
|
uses: codecov/codecov-action@v5
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
# - name: Upload integration test coverage
|
|
# if: ${{ always() }}
|
|
# uses: actions/upload-artifact@v4
|
|
# with:
|
|
# name: integration-test-coverage-${{ runner.os }}
|
|
# path: TestResults/integration/**
|
|
|
|
# Disabled, as a new test needs to be written for the new UI
|
|
# selenium:
|
|
# runs-on: ubuntu-latest
|
|
# steps:
|
|
# - uses: actions/checkout@v4
|
|
# - name: Selenium
|
|
# run: pipeline/selenium/test.sh
|