diff --git a/.github/actions/test/action.yml b/.github/actions/test/action.yml index 7eb0eb419..2451bcad5 100644 --- a/.github/actions/test/action.yml +++ b/.github/actions/test/action.yml @@ -18,6 +18,10 @@ inputs: filter: description: 'Filter for tests' required: true + binary_artifact: + description: 'Binary artifact for integration tests' + binary_path: + description: 'Path witin binary artifact for integration tests' runs: using: 'composite' @@ -44,11 +48,28 @@ runs: name: ${{ inputs.artifact }} path: _tests + - name: Download Binary Artifact + if: ${{ inputs.binary_artifact }} + uses: actions/download-artifact@v4 + with: + name: ${{ inputs.binary_artifact }} + path: _artifacts + + - name: Set up binary artifact + if: ${{ inputs.binary_path }} + shell: bash + run: mv ${{inputs.binary_path}} _tests/bin + - name: Make executable if: startsWith(inputs.platform, 'windows') != true shell: bash run: chmod +x ./_tests/Sonarr.Test.Dummy && chmod +x ./_tests/ffprobe + - name: Make Sonarr binary executable + if: ${{ inputs.binary_path }} && startsWith(inputs.platform, 'windows') != true + shell: bash + run: chmod +x ./_tests/bin/Sonarr + - name: Run tests shell: bash run: dotnet test ./_tests/Sonarr.*.Test.dll --filter "${{ inputs.filter }}" --logger trx --results-directory "TestResults-${{ matrix.dotnet-version }}" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 98608116a..605e47cd2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -153,3 +153,38 @@ jobs: pattern: Sonarr.*.Test.dll filter: TestCategory!=ManualTest&TestCategory!=WINDOWS&TestCategory!=IntegrationTest&TestCategory!=AutomationTest use_postgres: true + + integration_test: + needs: backend + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + include: + - os: ubuntu-latest + artifact: tests-linux-x64 + filter: TestCategory!=ManualTest&TestCategory!=WINDOWS&TestCategory=IntegrationTest + binary_artifact: linux + binary_path: linux-x64/net6.0/Sonarr + - os: macos-latest + artifact: tests-osx-x64 + filter: TestCategory!=ManualTest&TestCategory!=WINDOWS&TestCategory=IntegrationTest + binary_artifact: macos + binary_path: osx-x64/net6.0/Sonarr + - os: windows-latest + artifact: tests-win-x64 + filter: TestCategory!=ManualTest&TestCategory=WINDOWS&TestCategory=IntegrationTest + binary_artifact: windows + binary_path: win-x64/net6.0/Sonarr + runs-on: ${{ matrix.os }} + steps: + - name: Check out + uses: actions/checkout@v3 + + - name: Test + uses: ./.github/actions/test + with: + platform: ${{ matrix.os }} + artifact: ${{ matrix.artifact }} + pattern: Sonarr.*.Test.dll + filter: ${{ matrix.filter }} + binary_artifact: