Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: AIS Portal CI

on:
pull_request:
branches: [main]
push:
branches: [main]

# Cancel in-progress runs for the same PR/branch when new commits are pushed
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
pr-validation:
name: PR validation
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v7.0.1

- name: Setup Node.js environment
uses: actions/setup-node@v7.0.0
with:
node-version: 20
cache: npm

- name: Install dependencies
run: npm ci

- name: Validate Prisma schema
run: npx prisma validate

- name: Generate Prisma client
run: npx prisma generate

- name: Run ESLint
run: npm run lint

- name: Type check
run: npx tsc --noEmit

# Add unit tests here if applicable:
# - name: Run tests
# run: npm test

- name: Production build
run: npm run build

db-smoke:
name: Database smoke check
if: github.event_name == 'push'
runs-on: ubuntu-latest

env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
DIRECT_URL: ${{ secrets.DIRECT_URL }}

steps:
- name: Checkout repository
uses: actions/checkout@v7.0.1

- name: Setup Node.js environment
uses: actions/setup-node@v7.0.0
with:
node-version: 24
cache: npm

- name: Install Dependencies
run: npm ci

- name: Check Database Connectivity & Migration Status
run: npx prisma migrate status
Loading