boring.tools-poc/.gitea/workflows/test.yaml
Lars Hampe 3f53b112ae
Some checks failed
Build and Push Docker Image / tests (push) Failing after 34s
Build and Push Docker Image / build (push) Has been skipped
ci: rename postgres hostname, add postgres_url to test run
2024-10-01 14:18:56 +02:00

46 lines
1.0 KiB
YAML

name: Test
run-name: ${{ gitea.actor }}
on: [workflow_call]
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:17-alpine
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.1.29
- name: Install dependencies
run: bun install
- name: Push Database
run: bun run db:push
env:
POSTGRES_URL: postgres://postgres:postgres@postgres:5432/postgres
- name: Test API
run: bun test:api
env:
POSTGRES_URL: postgres://postgres:postgres@postgres:5432/postgres