Skip to content

test(examples): add e2e test to tanstack table examples and handson-table example #290

test(examples): add e2e test to tanstack table examples and handson-table example

test(examples): add e2e test to tanstack table examples and handson-table example #290

Workflow file for this run

name: e2e tests
on:
pull_request:
types: [synchronize]
schedule:
- cron: "0 6 * * *"
jobs:
find-cypress-config:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: kanga333/json-array-builder@main
id: array
with:
cmd: find . -name cypress.config.ts
separator: newline
outputs:
param: ${{ steps.array.outputs.build }}
run-cypress-tests:
needs:
- find-cypress-config
strategy:
matrix:
cypressConfig: ${{ fromJson(needs.find-cypress-config.outputs.param) }}
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v3
- name: Install & Build Deps
id: build-step
run: |
examplePath=$(echo "${{ matrix.cypressConfig }}" | sed 's/\/cypress.config.ts//g')
cd $examplePath
echo "::set-output name=example-path::$examplePath"
npm install
npm run start -- --port 3000 --host 127.0.0.1 &
- name: Get short SHA
id: slug
run: echo "::set-output name=sha7::$(echo ${GITHUB_SHA} | cut -c1-7)"
- name: Run Cypress on ${{ github.event_name }}
uses: cypress-io/github-action@v5
with:
install: false
command: npx cypress run --record -C ./cypress.config.ts --parallel --ci-build-id refine-${{ github.ref_name }}-${{ steps.build-step.outputs.example-path }}-${{ steps.slug.outputs.sha7 }}-${{ github.run_attempt }}
# start: pwd
wait-on: "http://127.0.0.1:3000"
# project: ${{ steps.build-step.outputs.example-path }}
working-directory: ${{ steps.build-step.outputs.example-path }}
tag: ${{ github.event_name }}
group: merge
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }}