From 54fd6aaeb54bc5da370a54ee8ff66fef55df3d57 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sun, 24 Dec 2023 20:06:51 -0800 Subject: [PATCH] Tests --- .github/actions/test/action.yml | 25 +++++++++++++++++++++++++ .github/workflows/build.yml | 8 ++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 .github/actions/test/action.yml diff --git a/.github/actions/test/action.yml b/.github/actions/test/action.yml new file mode 100644 index 000000000..9022f6106 --- /dev/null +++ b/.github/actions/test/action.yml @@ -0,0 +1,25 @@ +# https://docs.github.com/en/actions/creating-actions/creating-a-composite-action + +name: Run test on DLLs matching the specified pattern +description: Runs unit/integration tests + +inputs: + pattern: + description: 'Pattern for DLLs' + required: true + filter: + description: 'Filter for tests' + required: true + +runs: + using: 'composite' + steps: + - name: Setup .NET + uses: actions/setup-dotnet@v3 + + - name: Run tests + shell: bash + runs: | + for i in tests/${{ inputs.pattern }}; do + dotnet test $i --no-build -c Release --filter ${{ inputs.filter }} + done diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 092203c0d..0ec6128e1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -123,6 +123,10 @@ jobs: uses: actions/download-artifact@v4 with: name: tests-linux-x64 + path: tests - - name: Display structure of downloaded files - run: ls -R + - name: Test + uses: ./.github/actions/test + with: + pattern: Sonarr.*.Test.dll + filter: TestCategory!=ManualTest&TestCategory!=WINDOWS&TestCategory!=IntegrationTest&TestCategory!=AutomationTest