2022-01-10 19:25:48 +08:00
|
|
|
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
|
|
|
|
|
2022-02-21 16:11:17 +08:00
|
|
|
- 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 }}-
|
|
|
|
|
2022-01-10 19:25:48 +08:00
|
|
|
- name: Install dependencies
|
|
|
|
run: pnpm i --frozen-lockfile
|
|
|
|
|
|
|
|
- name: Install serve
|
|
|
|
run: pnpm install serve -D -w
|
|
|
|
|
|
|
|
- name: Serve documentation site
|
2022-01-10 22:48:27 +08:00
|
|
|
run: pnpm exec serve docs -p 5001 &
|
2022-01-10 19:25:48 +08:00
|
|
|
|
|
|
|
- name: Run Cypress
|
|
|
|
run: npx cypress run
|