This action will add nuget to your $PATH on all operating systems, including macOS and linux, without having to prefix it with mono.
64 lines
1.8 KiB
YAML
64 lines
1.8 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 --work=TestResultsLinux
|
|
|
|
- name: Run Unit Tests (Windows)
|
|
if: matrix.os == 'windows-latest'
|
|
run: nunit3-console.exe Duplicati/UnitTest/bin/Release/Duplicati.UnitTest.dll --where:cat==Utility --work=TestResultsWindows
|
|
|
|
- name: Report Unit Test Results (Linux)
|
|
uses: MirrorNG/nunit-reporter@v1.0.11
|
|
if: always()
|
|
with:
|
|
path: TestResultsLinux/**/*.xml
|
|
reportTitle: Unit Test Results (Linux)
|
|
access-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Report Unit Test Results (Windows)
|
|
uses: MirrorNG/nunit-reporter@v1.0.11
|
|
if: always()
|
|
with:
|
|
path: TestResultsWindows/**/*.xml
|
|
reportTitle: Unit Test Results (Windows)
|
|
access-token: ${{ secrets.GITHUB_TOKEN }}
|