Skip to content

Commit

Permalink
Added github action to run tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aliofye authored Jan 14, 2025
1 parent 27dc445 commit 3b5a114
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CI Pipeline

on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
name: template
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: test
POSTGRES_PASSWORD: test
POSTGRES_DB: postgres
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready -U test -d postgres"
--health-interval=10s
--health-timeout=5s
--health-retries=5
env:
DATABASE_URL: postgres://test:test@localhost:5432/postgres
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install bun
uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install
- name: Wait for Database
run: |
until pg_isready -h localhost -p 5432 -U test_user -d test_db; do
echo "Waiting for PostgreSQL...";
sleep 3;
done
- name: Run migrations
run: bun run db:migrate
- name: Run tests
run: bun run test

0 comments on commit 3b5a114

Please sign in to comment.