Fix type #15
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: Server Tests | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "server/**" | |
pull_request: | |
branches: | |
- main | |
paths: | |
- "server/**" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
name: Server Typecheck, Lint, and Tests | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
services: | |
postgres: | |
image: postgres:15 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: test_db | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Bun | |
uses: oven-sh/setup-bun@v2 | |
- name: Install dependencies | |
run: bun install | |
- name: Setup environment | |
run: | | |
echo "DATABASE_URL=postgres://postgres:postgres@localhost:5432/test_db" >> $GITHUB_ENV | |
- name: Run database migrations | |
run: bun db:migrate | |
- name: Run tests | |
run: bun test | |
- name: Run linter | |
run: bun lint | |
- name: Type check | |
run: bun typecheck | |
- name: Cache dependencies | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.bun/install/cache | |
node_modules | |
.eslintcache | |
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }} | |
restore-keys: | | |
${{ runner.os }}-bun- |