Skip to content

Commit

Permalink
test: run cypress tests individually
Browse files Browse the repository at this point in the history
  • Loading branch information
kevkevinpal committed Sep 20, 2024
1 parent abf49ae commit c6ca3d9
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,42 @@ on:
branches:
- master
jobs:
get-cypress-tests:
runs-on:
ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: ./sphinx-nav-fiber

- name: Debug test files
working-directory: ./sphinx-nav-fiber
run: |
find cypress/e2e -name '*.spec.js' -o -name '*.cy.ts' | jq -R -s -c 'split("\n") | map(select(. != ""))'
- name: List Cypress test files
id: list-tests
working-directory: ./sphinx-nav-fiber
run: |
tests=$(find cypress/e2e -name '*.spec.js' -o -name '*.cy.ts' | jq -R -s -c 'split("\n") | map(select(. != ""))')
if [ -z "$tests" ]; then
echo "No Cypress test files found."
tests="[]"
fi
echo "::set-output name=tests::$tests"
outputs:
tests: ${{ steps.list-tests.outputs.tests }}

cypress-run:
runs-on: ubuntu-latest
needs: get-cypress-tests
strategy:
fail-fast: false
matrix:
file: ${{ fromJson(needs.get-cypress-tests.outputs.tests) }}
steps:
- name: Enable docker.host.internal for Ubuntu
run: |
Expand Down Expand Up @@ -81,6 +115,7 @@ jobs:
browser: chrome
headless: true
start: yarn run start-e2e
spec: ${{ matrix.file }}
wait-on: 'http://localhost:3000' # Waits for above
wait-on-timeout: 120 # Waits for 2 minutes
# Records to Cypress Dashboard
Expand Down

0 comments on commit c6ca3d9

Please sign in to comment.