Files

50 lines
1.5 KiB
YAML

name: Test
on:
pull_request:
push:
branches:
- develop
- master
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 30
services:
postgres:
image: postgres:17
env:
POSTGRES_DB: logos_test
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
options: >-
--health-cmd "pg_isready -U postgres -d logos_test"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/logos_test
# Authenticates build-time GitHub API calls (RFP markdown is fetched from
# logos-co/rfp during `next build`). Unauthenticated requests share a
# 60 req/hr-per-IP limit across runners and intermittently 403, which fails
# the static export. The Actions-provided token lifts this to 1,000/hr.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEPLOYMENT_VERSION: ci
NEXT_PUBLIC_API_MODE: production
NEXT_PUBLIC_SERVER_URL: http://localhost:3001
NEXT_PUBLIC_WEB_URL: http://localhost:3000
PAYLOAD_SECRET: test-secret-at-least-32-characters
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v6
with:
node-version: 24
cache: pnpm
- run: echo "NEXT_SERVER_ACTIONS_ENCRYPTION_KEY=$(openssl rand -base64 32)" >> "$GITHUB_ENV"
- run: CI=true pnpm install --frozen-lockfile
- run: pnpm test:release