Shortest Tests #193
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Shortest Tests" | |
on: | |
# We want to listen to Vercel deployment status events | |
deployment_status | |
jobs: | |
shortest: | |
# Only run on Vercel deployment success | |
if: | | |
github.event.deployment_status.state == 'success' && | |
contains(github.event.deployment_status.target_url, 'vercel.app') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: "pnpm" | |
- name: Install dependencies | |
run: pnpm install | |
- name: Install Playwright browsers | |
run: pnpm exec playwright install | |
- name: Get Vercel preview URL | |
id: vercel_url | |
run: | | |
DEPLOY_URL="${{ github.event.deployment_status.target_url }}" | |
echo "url=$DEPLOY_URL" >> $GITHUB_OUTPUT | |
- name: Run Shortest tests | |
env: | |
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
run: pnpm shortest --headless --target=${{ steps.vercel_url.outputs.url }} |