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