chore(ci): reorganize CI workflows and add depcheck and playwright jobs
All checks were successful
/ build-and-deploy-to-vercel (push) Successful in 1m39s
/ depcheck (push) Successful in 2m20s
/ playwright (push) Successful in 1m18s
/ surge (push) Successful in 52s

This commit is contained in:
mini2024
2025-01-24 00:05:41 +08:00
parent a7312f402f
commit 14fdb7ef1f
5 changed files with 79 additions and 67 deletions

33
.github/workflows/playwright.yaml vendored Normal file
View File

@ -0,0 +1,33 @@
defaults:
run:
shell: bash
env:
TZ: Asia/Shanghai
on:
push:
jobs:
surge:
runs-on: ubuntu-latest
outputs:
url: ${{ steps.surge_deploy.outputs.url }}
steps:
- uses: yanhao98/composite-actions/setup-node-environment@main
- run: pnpm run build-only
env:
VITE_BUILD_COMMIT: ${{ github.sha }}
- name: 部署到 Surge
id: surge_deploy
if: ${{ github.actor != 'nektos/act' }} # https://nektosact.com/usage/index.html#skipping-steps
uses: yanhao98/composite-actions/deploy-dist-to-surge@main
playwright:
needs: surge
runs-on: ubuntu-latest
container: yanhao98/runner-images:pnpm-with-playwright
steps:
- uses: yanhao98/composite-actions/setup-node-environment@main
# - name: Install Playwright Browsers
# run: pnpm exec playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test
env:
BASE_URL: ${{ needs.surge.outputs.url }}