Files
duplicati/.github/workflows/tests.yml
T

87 lines
2.6 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 coverage reports to Codecov
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{ github.workspace }}/TestResults/integration/**/coverage.cobertura.xml
flags: unittest,${{ matrix.os }}
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@5a1091511ad55cbe89839c7260b706298ca349f7
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{ github.workspace }}/TestResults/integration/**/coverage.cobertura.xml
flags: integration,${{ matrix.os }}
# 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