From 063e1635feeb8b6e761ee744436e83d03a117c8a Mon Sep 17 00:00:00 2001 From: Brandon Casey <2381475+brandonocasey@users.noreply.github.com> Date: Wed, 23 Jun 2021 12:44:23 -0400 Subject: [PATCH] chore: skip playback tests in forks (#1148) --- .github/workflows/ci.yml | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 91a1b786a..3994df17f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,14 +15,29 @@ jobs: with: github_token: ${{github.token}} + # generate our test-type matrix, forks should not run playback tests + test-type-matrix: + runs-on: ubuntu-latest + outputs: + test-type: ${{steps.test-type-fork.outputs.test_type || steps.test-type.outputs.test_type}} + steps: + - id: test-type-fork + if: ${{github.event.pull_request.head.repo.fork}} + run: echo '::set-output name=test_type::["unit", "coverage"]' + - id: test-type + if: ${{!github.event.pull_request.head.repo.fork}} + run: echo '::set-output name=test_type::["unit", "playback", "playback-min", "coverage"]' + + ci: - needs: should-skip - if: ${{needs.should-skip.outputs.should-skip-job != 'true' || github.ref == 'refs/heads/main'}} + needs: [should-skip, test-type-matrix] + # 1. always run tests on main, otherwise skip tests if should-skip is true. + if: ${{github.ref == 'refs/heads/main' || needs.should-skip.outputs.should-skip-job != 'true'}} strategy: fail-fast: false matrix: os: [ubuntu-latest] - test-type: [unit, playback, playback-min, coverage] + test-type: ${{fromJson(needs.test-type-matrix.outputs.test-type)}} env: BROWSER_STACK_USERNAME: ${{secrets.BROWSER_STACK_USERNAME}} BROWSER_STACK_ACCESS_KEY: ${{secrets.BROWSER_STACK_ACCESS_KEY}}