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

77 lines
2.1 KiB
YAML

name: Tests
on:
push:
branches: "*"
pull_request:
branches: "*"
jobs:
test:
name: Run tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest ]
steps:
- name: Install mono
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install mono-complete
- name: Add msbuild to PATH
if: matrix.os == 'windows-latest'
uses: microsoft/setup-msbuild@v1.0.2
- name: Checkout Source
uses: actions/checkout@v2
- name: Install NuGet
uses: nuget/setup-nuget@v1.0.5
- name: Build Duplicati
run: |
nuget restore Duplicati.sln
msbuild -p:Configuration=Release Duplicati.sln
- name: Run Unit Tests (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
nuget install NUnit.Runners -Version 3.12.0 -OutputDirectory nunit
mono nunit/NUnit.ConsoleRunner.3.12.0/tools/nunit3-console.exe Duplicati/UnitTest/bin/Release/Duplicati.UnitTest.dll --where:cat==Utility --result="TestResults/test_results_${{ matrix.os }}.xml"
- name: Run Unit Tests (Windows)
if: matrix.os == 'windows-latest'
run: |
nuget install NUnit.Runners -Version 3.12.0 -OutputDirectory nunit
nunit/NUnit.ConsoleRunner.3.12.0/tools/nunit3-console.exe Duplicati/UnitTest/bin/Release/Duplicati.UnitTest.dll --where:cat==Utility --result="TestResults/test_results_${{ matrix.os }}.xml"
- name: Upload Unit Test Results
if: always()
uses: actions/upload-artifact@v2
with:
name: Unit Test Results
path: TestResults
report-test-results:
name: Report Unit Test Results
needs: test
runs-on: ubuntu-latest
if: always()
steps:
- name: Download Artifacts
uses: actions/download-artifact@v2
with:
name: Unit Test Results
path: TestResults
- name: Report Unit Test Results
uses: MirrorNG/nunit-reporter@v1.0.11
with:
path: TestResults/**/*.xml
reportTitle: Unit Test Results
access-token: ${{ secrets.GITHUB_TOKEN }}