diff --git a/.github/actions/test/action.yml b/.github/actions/test/action.yml index 5468f7706..2a710d42b 100644 --- a/.github/actions/test/action.yml +++ b/.github/actions/test/action.yml @@ -6,8 +6,8 @@ description: Runs unit/integration tests inputs: use_postgres: description: 'Whether postgres should be used for the database' - platform: - description: 'OS platform that the tests are running on' + os: + description: 'OS that the tests are running on' required: true artifact: description: 'Test binary artifact' @@ -18,9 +18,10 @@ inputs: filter: description: 'Filter for tests' required: true + integation_tests: + description: 'True if running integration tests' binary_artifact: description: 'Binary artifact for integration tests' - default: '' binary_path: description: 'Path witin binary artifact for integration tests' @@ -57,20 +58,20 @@ runs: path: _artifacts - name: Set up binary artifact - if: ${{ inputs.binary_path }} + if: ${{ inputs.binary_path != '' }} shell: bash run: mv ${{inputs.binary_path}} _tests/bin - name: Make executable - if: startsWith(inputs.platform, 'windows') != true + if: startsWith(inputs.os, '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 + if: ${{ integation_tests && !startsWith(inputs.os, 'windows') }} 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 }}" + run: dotnet test ./_tests/Sonarr.*.Test.dll --filter "${{ inputs.filter }}" --logger trx --results-directory "${{ inputs.integration_tests && integation_ || unit_ }}${{ env.platform }}" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 605e47cd2..94e1fa6e6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -133,7 +133,7 @@ jobs: - name: Test uses: ./.github/actions/test with: - platform: ${{ matrix.os }} + os: ${{ matrix.os }} artifact: ${{ matrix.artifact }} pattern: Sonarr.*.Test.dll filter: ${{ matrix.filter }} @@ -148,7 +148,7 @@ jobs: - name: Test uses: ./.github/actions/test with: - platform: ubuntu-latest + os: ubuntu-latest artifact: tests-linux-x64 pattern: Sonarr.*.Test.dll filter: TestCategory!=ManualTest&TestCategory!=WINDOWS&TestCategory!=IntegrationTest&TestCategory!=AutomationTest @@ -183,8 +183,10 @@ jobs: - name: Test uses: ./.github/actions/test with: - platform: ${{ matrix.os }} + os: ${{ matrix.os }} artifact: ${{ matrix.artifact }} pattern: Sonarr.*.Test.dll filter: ${{ matrix.filter }} - binary_artifact: + integration_test: true + binary_artifact: ${{ matrix.binary_artifact }} + binary_path: ${{ matrix.binary_path }}