Skip to content

fix(ops): move metrics endpoint under /api/ops so vite proxies it #93

fix(ops): move metrics endpoint under /api/ops so vite proxies it

fix(ops): move metrics endpoint under /api/ops so vite proxies it #93

Workflow file for this run

name: Web
on:
push:
paths:
- 'web/**'
- '.github/workflows/web.yml'
- 'pnpm-lock.yaml'
- 'pnpm-workspace.yaml'
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
lint:
name: lint (22.20.0)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v6
with:
node-version: 22.20.0
cache: pnpm
- name: Cache node_modules
id: modules-cache
uses: actions/cache@v4
with:
path: |
node_modules
web/node_modules
key: node-modules-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
- name: Install
if: steps.modules-cache.outputs.cache-hit != 'true'
run: pnpm install --frozen-lockfile
env:
CI: true
- name: Lint
run: pnpm --filter 2anki-web lint
env:
CI: true
build:
name: build (22.20.0)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v6
with:
node-version: 22.20.0
cache: pnpm
- name: Cache node_modules
id: modules-cache
uses: actions/cache@v4
with:
path: |
node_modules
web/node_modules
key: node-modules-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
- name: Install
if: steps.modules-cache.outputs.cache-hit != 'true'
run: pnpm install --frozen-lockfile
env:
CI: true
- name: Typecheck
run: pnpm --filter 2anki-web typecheck
env:
CI: true
- name: Cache dist
id: dist-cache
uses: actions/cache@v4
with:
path: web/build
key: dist-${{ runner.os }}-${{ hashFiles('web/src/**', 'web/public/**', 'web/index.html', 'web/vite.config.*', 'web/tsconfig*', 'pnpm-lock.yaml') }}
- name: Build
if: steps.dist-cache.outputs.cache-hit != 'true'
run: pnpm --filter 2anki-web build
env:
CI: true
test:
name: test (22.20.0)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v6
with:
node-version: 22.20.0
cache: pnpm
- name: Cache node_modules
id: modules-cache
uses: actions/cache@v4
with:
path: |
node_modules
web/node_modules
key: node-modules-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
- name: Install
if: steps.modules-cache.outputs.cache-hit != 'true'
run: pnpm install --frozen-lockfile
env:
CI: true
- name: Test
run: pnpm --filter 2anki-web test
env:
CI: true
playwright:
name: playwright (22.20.0)
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v6
with:
node-version: 22.20.0
cache: pnpm
- name: Cache node_modules
id: modules-cache
uses: actions/cache@v4
with:
path: |
node_modules
web/node_modules
key: node-modules-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
- name: Install
if: steps.modules-cache.outputs.cache-hit != 'true'
run: pnpm install --frozen-lockfile
- name: Cache Playwright browsers
id: playwright-cache
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
- name: Install Playwright Browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: pnpm --filter 2anki-web exec playwright install --with-deps chromium
- name: Cache dist
id: dist-cache
uses: actions/cache@v4
with:
path: web/build
key: dist-${{ runner.os }}-${{ hashFiles('web/src/**', 'web/public/**', 'web/index.html', 'web/vite.config.*', 'web/tsconfig*', 'pnpm-lock.yaml') }}
- name: Build the application
if: steps.dist-cache.outputs.cache-hit != 'true'
run: pnpm --filter 2anki-web build
- name: Run Playwright tests
working-directory: web
run: pnpm exec playwright test
env:
PLAYWRIGHT_WITH_MOCK: true
- uses: actions/upload-artifact@v7
if: always()
with:
name: playwright-report
path: web/playwright-report/
retention-days: 30