feat(ci): self-hosted server test suite

This commit is contained in:
Gergő Móricz 2025-02-19 21:55:48 +01:00
parent dab0016669
commit 9976560567
2 changed files with 42 additions and 20 deletions

View File

@ -1,20 +0,0 @@
name: Clean Every 30 Minutes Before 24h Completed Jobs
on:
schedule:
- cron: '30 * * * *'
env:
BULL_AUTH_KEY: ${{ secrets.BULL_AUTH_KEY }}
jobs:
clean-jobs:
runs-on: ubuntu-latest
steps:
- name: Send GET request to clean jobs
run: |
response=$(curl --write-out '%{http_code}' --silent --output /dev/null --max-time 180 https://api.firecrawl.dev/admin/${{ secrets.BULL_AUTH_KEY }}/clean-before-24h-complete-jobs)
if [ "$response" -ne 200 ]; then
echo "Failed to clean jobs. Response: $response"
exit 1
fi
echo "Successfully cleaned jobs. Response: $response"

View File

@ -0,0 +1,42 @@
name: Self-hosted Server Test Suite
on:
workflow_dispatch:
env:
PORT: 3002
REDIS_URL: redis://localhost:6379
ENV: ${{ secrets.ENV }}
jobs:
test:
name: Run tests
runs-on: ubuntu-latest
services:
redis:
image: redis
ports:
- 6379:6379
steps:
- uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "20"
- name: Install pnpm
run: npm install -g pnpm
- name: Install dependencies
run: pnpm install
working-directory: ./apps/api
- name: Start the application
run: npm start &
working-directory: ./apps/api
id: start_app
- name: Start workers
run: npm run workers &
working-directory: ./apps/api
id: start_workers
- name: Run snippet tests
run: |
npm run test:snips
working-directory: ./apps/api