61 lines
No EOL
1.2 KiB
YAML
61 lines
No EOL
1.2 KiB
YAML
name: CI Testing (API)
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- "api/**"
|
|
push:
|
|
paths:
|
|
- "api/**"
|
|
|
|
defaults:
|
|
run:
|
|
working-directory: api
|
|
|
|
env:
|
|
DATABASE_URL: "postgresql://nextnet:nextnet@localhost:5432/nextnet?schema=nextnet"
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres
|
|
env:
|
|
POSTGRES_PASSWORD: nextnet
|
|
POSTGRES_USER: nextnet
|
|
POSTGRES_DB: nextnet
|
|
options: >-
|
|
--health-cmd pg_isready
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
ports:
|
|
- 5432:5432
|
|
|
|
steps:
|
|
- name: Checkout code using Git
|
|
uses: actions/checkout@main
|
|
|
|
- name: Install Node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20.x
|
|
|
|
- name: Install dependencies
|
|
run: npm install --save-dev
|
|
|
|
- name: Install prisma
|
|
run: npx prisma migrate dev
|
|
|
|
- name: Build source
|
|
run: npm run build
|
|
|
|
- name: Run eslint
|
|
run: npx eslint src
|
|
|
|
- name: Run prettier to verify if we're formatted or not
|
|
uses: creyD/prettier_action@v4.3
|
|
with:
|
|
dry: true |