Skip to content

Build/change structure #462

Build/change structure

Build/change structure #462

Workflow file for this run

name: CI - Node
on:
push:
branches:
- "main"
- "development"
paths:
- "backend/node/**"
- ".github/workflows/node.yml"
pull_request:
branches:
- "main"
- "development"
paths:
- "backend/node/**"
- ".github/workflows/node.yml"
jobs:
build:
name: Build (Node v${{ matrix.node }})
runs-on: ubuntu-latest
services:
postgres:
image: docker.io/library/postgres:14-alpine
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
strategy:
matrix:
node: ['20', '21']
env:
FOLDER: backend/node
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'pnpm'
cache-dependency-path: ${{ env.FOLDER }}/pnpm-lock.yaml
- name: Install dependencies
run: |
cd ${{ env.FOLDER }}
pnpm install
- name: Run linter
run: |
cd ${{ env.FOLDER }}
pnpm lint
- name: Run prettier
run: |
cd ${{ env.FOLDER }}
pnpm prettier
- name: Run typecheck
run: |
cd ${{ env.FOLDER }}
pnpm typecheck
- name: Run build
run: |
cd ${{ env.FOLDER }}
pnpm build
- name: Run tests
run: |
cd ${{ env.FOLDER }}
cp .env.testing .env
pnpm migrate:up
pnpm seed:run
pnpm test