Skip to content

Commit

Permalink
chore: skip playback tests in forks (#1148)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonocasey authored Jun 23, 2021
1 parent 62f9c1c commit 063e163
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down

0 comments on commit 063e163

Please sign in to comment.