ci: add pnpm setup for all steps #23
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 | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
install: | |
name: Install & Cache Dependencies | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "22" | |
cache: "pnpm" | |
- name: Install dependencies | |
run: pnpm install | |
code_style: | |
name: Prettier Check | |
runs-on: ubuntu-latest | |
needs: install | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- name: Prettier Check | |
run: pnpm run prettier:check | |
type_check: | |
name: Type Check | |
runs-on: ubuntu-latest | |
needs: install | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- name: Type Check | |
run: pnpm run typecheck | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
needs: install | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- name: Lint | |
run: pnpm run lint | |
build_backend: | |
name: Build Backend | |
runs-on: ubuntu-latest | |
needs: install | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- name: Build Backend | |
run: pnpm --filter backend build | |
build_frontend: | |
name: Build Frontend | |
runs-on: ubuntu-latest | |
needs: install | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- name: Build Frontend | |
env: | |
NEXT_PUBLIC_API_URL: https://staging.api.boklisten.no/ | |
NEXT_PUBLIC_BL_WEB_URL: https://staging.boklisten.no/ | |
NEXT_PUBLIC_BL_ADMIN_URL: https://staging.bladmin.boklisten.no/ | |
run: pnpm --filter frontend build | |
test_backend: | |
name: Test Backend | |
runs-on: ubuntu-latest | |
needs: install | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- name: Test Backend | |
run: pnpm --filter backend test |