ci-backend.yml had pull_request: types: [opened, reopened], which excludes synchronize, so pushes to an open PR branch did not re-run backend tests, lint or coverage and a broken follow-up commit could land after the first green run. Drop the types filter so all default pull_request events trigger the workflow. ci-frontend.yml and ci-frontend-api.yml now install with pnpm install --frozen-lockfile instead of pnpm i, matching release.yml and preventing silent lockfile drift in CI.
132 lines
2.9 KiB
YAML
132 lines
2.9 KiB
YAML
name: "@remark42/api"
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
paths:
|
|
- ".github/workflows/ci-frontend-api.yml"
|
|
- "frontend/packages/**"
|
|
- "!**.md"
|
|
pull_request:
|
|
paths:
|
|
- ".github/workflows/ci-frontend-api.yml"
|
|
- "frontend/packages/**"
|
|
- "!**.md"
|
|
|
|
jobs:
|
|
type-check:
|
|
name: Type check
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
strategy:
|
|
matrix:
|
|
node: [ 20 ]
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@v6.0.9
|
|
with:
|
|
version: 10.10.0
|
|
run_install: false
|
|
|
|
- name: Install node
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: ${{ matrix.node }}
|
|
cache: "pnpm"
|
|
cache-dependency-path: frontend/pnpm-lock.yaml
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
working-directory: ./frontend
|
|
|
|
- name: Run type check
|
|
run: pnpm type-check:api
|
|
working-directory: ./frontend
|
|
|
|
lint:
|
|
name: Lint
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
strategy:
|
|
matrix:
|
|
node: [ 20 ]
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@v6.0.9
|
|
with:
|
|
version: 10.10.0
|
|
run_install: false
|
|
|
|
- name: Install node
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: ${{ matrix.node }}
|
|
cache: "pnpm"
|
|
cache-dependency-path: frontend/pnpm-lock.yaml
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
working-directory: ./frontend
|
|
|
|
- name: Run linters
|
|
run: pnpm lint:api
|
|
working-directory: ./frontend/
|
|
|
|
test:
|
|
name: Tests & Coverage
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
strategy:
|
|
matrix:
|
|
node: [ 20 ]
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@v6.0.9
|
|
with:
|
|
version: 10.10.0
|
|
run_install: false
|
|
|
|
- name: Install node
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: ${{ matrix.node }}
|
|
cache: "pnpm"
|
|
cache-dependency-path: frontend/pnpm-lock.yaml
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
working-directory: ./frontend
|
|
|
|
- name: Test & Coverage
|
|
run: pnpm coverage:api
|
|
working-directory: ./frontend
|
|
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v7
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
working-directory: ./frontend
|
|
codecov_yml_path: ./frontend/apps/remark42/codecov.yml
|