Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/duplicati/duplicati.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwarwickmm <warwickmm@users.noreply.github.com>2021-05-03 21:47:18 +0300
committerGitHub <noreply@github.com>2021-05-03 21:47:18 +0300
commitda2e51a80bb9b1848418fe0be69cf68a9df920e5 (patch)
tree9881ea7ee9c2a75fd632abee06533b357204235d /.github
parentbeaf03562fdcf4425e962085bdf7175d6a465f49 (diff)
parent54cd890879321f7e73723608325a6fd43f61573a (diff)
Merge pull request #4431 from warwickmm/add_workflow_for_tests
Add GitHub workflow to run tests
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/tests.yml88
1 files changed, 88 insertions, 0 deletions
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
new file mode 100644
index 000000000..572f4a258
--- /dev/null
+++ b/.github/workflows/tests.yml
@@ -0,0 +1,88 @@
+name: Tests
+
+on:
+ push:
+ branches: "*"
+ pull_request:
+ branches: "*"
+
+env:
+ build_directory: "Duplicati/GUI/Duplicati.GUI.TrayIcon/bin/Release"
+
+jobs:
+ unit_tests:
+ name: Unit tests
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [ ubuntu-latest, windows-latest, macos-latest ]
+
+ steps:
+ - name: Add msbuild to PATH (Windows)
+ if: matrix.os == 'windows-latest'
+ uses: microsoft/setup-msbuild@v1.0.2
+
+ - name: Install NuGet
+ uses: nuget/setup-nuget@v1.0.5
+
+ - name: Checkout Source
+ uses: actions/checkout@v2.3.4
+
+ - name: Restore NuGet Packages
+ run: nuget restore Duplicati.sln
+
+ - name: Build Duplicati (Linux and macOS)
+ if: matrix.os != 'windows-latest'
+ run: msbuild -p:Configuration=Release -p:DefineConstants=ENABLE_GTK Duplicati.sln
+
+ - name: Build Duplicati (Windows)
+ if: matrix.os == 'windows-latest'
+ run: msbuild -p:Configuration=Release Duplicati.sln
+
+ - name: Run Unit Tests (Linux and macOS)
+ if: matrix.os != 'windows-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
+
+ - 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
+
+ ui_tests:
+ name: UI tests
+ runs-on: ubuntu-latest
+
+ # Some of these steps duplicate those in the unit_tests job above. This
+ # can be cleaned up using a composite run steps action once it supports
+ # what we need (https://github.com/actions/runner/issues/646).
+ steps:
+ - name: Checkout Source
+ uses: actions/checkout@v2.3.4
+
+ - name: Install NuGet
+ uses: nuget/setup-nuget@v1.0.5
+
+ - name: Build Duplicati
+ run: |
+ nuget restore Duplicati.sln
+ msbuild -p:Configuration=Release -p:DefineConstants=ENABLE_GTK Duplicati.sln
+
+ - name: Set up Python
+ uses: actions/setup-python@v2
+ with:
+ python-version: 3.x
+
+ - name: Install dependencies
+ run: |
+ pip3 install selenium
+ pip3 install --upgrade urllib3
+
+ - name: Run UI tests
+ run: |
+ cp -r Duplicati/Server/webroot "${{ env.build_directory }}"/webroot
+ mono "${{ env.build_directory }}"/Duplicati.Server.exe &
+ python3 guiTests/guiTest.py