Build/change structure #455
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
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.example .env | |
docker compose up -d | |
sleep 10s | |
pnpm migrate:up | |
pnpm seed:run | |
pnpm test | |
docker compose down -v | |