Skip to content

fix: Use name for profile lookup #83

fix: Use name for profile lookup

fix: Use name for profile lookup #83

name: API v2
on:
pull_request:
branches:
- main
paths:
- apps/v2/**
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Setup
uses: ./tooling/github/setup
- name: Install dependencies
run: pnpm install
- name: Build @noroff/api-utils
run: "pnpm build:api-utils"
- name: Build @noroff/logger
run: "pnpm build:logger"
- name: Build @noroff/api-v2
run: "pnpm build:v2"
test:
name: Test
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14.1-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
env:
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/test
JWT_SECRET: ${{ secrets.JWT_SECRET }}
PORT: ${{ secrets.PORT }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Setup
uses: ./tooling/github/setup
- name: Install dependencies
run: pnpm install
- name: Build @noroff/api-utils
run: "pnpm build:api-utils"
- name: Build @noroff/logger
run: "pnpm build:logger"
- name: Run Prisma migrations
run: pnpm prisma migrate deploy
working-directory: apps/v2
- name: Run tests
run: pnpm test
working-directory: apps/v2