test(e2e): setup initial e2e tests #4
Workflow file for this run
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: 🧪 Test code | |
# Run this on every push except master and next | |
on: | |
push: | |
branches: | |
- '**' | |
- '!master' | |
- '!next' | |
permissions: | |
contents: read | |
jobs: | |
test: | |
# Use the latest version of Ubuntu | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
issues: write | |
pull-requests: write | |
id-token: write | |
steps: | |
# Checkout repository | |
- name: 📥 Checkout code | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
# Setup Node | |
- name: 📦 Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "lts/*" | |
cache: "npm" | |
# Install dependencies | |
- name: 📦 Install dependencies | |
run: npm ci | |
# Lint code | |
- name: 🧹 Lint code | |
run: npm run lint | |
# Run tests | |
- name: 🧪 Run tests | |
run: npm test | |
# Setup PocketBase | |
- name: 🗄️ Download and setup PocketBase | |
run: npm run test:e2e:setup | |
# Start PocketBase | |
- name: 🚀 Start PocketBase | |
run: ./.pocketbase/pocketbase serve & | |
# Wait for PocketBase to be ready | |
- name: ⏳ Wait for PocketBase | |
run: | | |
until curl -s --fail http://localhost:8090/api/health; do | |
echo 'Waiting for PocketBase...' | |
sleep 5 | |
done | |
# Run tests | |
- name: 🧪 Run e2e tests | |
run: npm run test:e2e |