ci: add testing
This commit is contained in:
parent
0d0e241e68
commit
8f53f4c675
@ -6,7 +6,10 @@ on:
|
|||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
tests:
|
||||||
|
uses: ./.gitea/workflows/test.yaml
|
||||||
build:
|
build:
|
||||||
|
needs: [tests]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
44
.gitea/workflows/test.yaml
Normal file
44
.gitea/workflows/test.yaml
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
name: Test
|
||||||
|
run-name: ${{ gitea.actor }}
|
||||||
|
on: [workflow_call]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
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@localhost:5432/postgres
|
||||||
|
|
||||||
|
- name: Test API
|
||||||
|
run: bun test:api
|
@ -7,6 +7,10 @@
|
|||||||
"check:packages": "bunx biome check --write --config-path ./biome.json ./packages",
|
"check:packages": "bunx biome check --write --config-path ./biome.json ./packages",
|
||||||
"dev": "bun --filter '*' dev",
|
"dev": "bun --filter '*' dev",
|
||||||
"build": "bun --filter '*' build",
|
"build": "bun --filter '*' build",
|
||||||
|
"db:generate": "bun --filter '@boring.tools/database' db:generate",
|
||||||
|
"db:migrate": "bun --filter '@boring.tools/database' db:migrate",
|
||||||
|
"db:push": "bun --filter '@boring.tools/database' db:push",
|
||||||
|
"test:api": "bun --filter '@boring.tools/api' test",
|
||||||
"docker:website:build": "docker build -t git.hashdot.co/boring.tools/boring.tools/website -f ci/docker/website/Dockerfile .",
|
"docker:website:build": "docker build -t git.hashdot.co/boring.tools/boring.tools/website -f ci/docker/website/Dockerfile .",
|
||||||
"docker:website:push": "docker push git.hashdot.co/boring.tools/boring.tools/website",
|
"docker:website:push": "docker push git.hashdot.co/boring.tools/boring.tools/website",
|
||||||
"docker:website": "bun docker:website:build && bun docker:website:push",
|
"docker:website": "bun docker:website:build && bun docker:website:push",
|
||||||
|
Loading…
Reference in New Issue
Block a user