element-plus/.github/workflows/cypress.yml
2022-02-21 16:11:17 +08:00

52 lines
1.3 KiB
YAML

name: Cypress E2E testing
on:
workflow_run:
workflows: ['Website Preview']
types: [completed]
jobs:
cypress-run:
name: Cypress Run
runs-on: ubuntu-latest
container: cypress/browsers:node14.7.0-chrome84
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: ${{ github.event.workflow.id }}
run_id: ${{ github.event.workflow_run.id }}
name: docs
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: latest
- name: Cache ~/.pnpm-store
uses: actions/cache@v2
env:
cache-name: cache-pnpm-store
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- name: Install dependencies
run: pnpm i --frozen-lockfile
- name: Install serve
run: pnpm install serve -D -w
- name: Serve documentation site
run: pnpm exec serve docs -p 5001 &
- name: Run Cypress
run: npx cypress run