Skip to content

Update linters (major) #1866

Update linters (major)

Update linters (major) #1866

Workflow file for this run

name: Pull request checks
on:
push:
branches:
- main
paths-ignore:
- '.github/workflows/**'
- '!.github/workflows/PRs.yml'
- '*.md'
- 'docs/**'
- 'renovate.json'
pull_request:
paths-ignore:
- '.github/workflows/**'
- '!.github/workflows/PRs.yml'
- '*.md'
- 'docs/**'
- 'renovate.json'
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
test-api:
timeout-minutes: 10
runs-on: ubuntu-latest
strategy:
matrix:
shard: [1, 2, 3]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4
with:
node-version-file: .node-version
cache: pnpm
- name: Install
run: pnpm install
- name: Build
run: npm run build
- name: Run API tests
run: npm run test -- --shard ${{ matrix.shard }}/${{ strategy.job-total }} --coverage
- name: Upload coverage
uses: codecov/codecov-action@e0b68c6749509c5f83f984dd99a76a1c1a231044 # v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/coverage-final.json
lint:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4
with:
node-version-file: .node-version
cache: pnpm
- name: Install
run: pnpm install && pnpm --dir frontend install
- name: Check formatting
run: npm run pretty
- name: Check backend linting
run: npm run lint:backend
- name: Check consumer linting
run: npm run lint:consumer
- name: Check do linting
run: npm run lint:do
- name: Check frontend linting
run: npm run lint:frontend
- name: Check frontend types
continue-on-error: true
working-directory: frontend
run: npm run types-check
- name: Setup Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5
with:
go-version: stable
- name: Install sqlite3def
run: go install github.com/sqldef/sqldef/cmd/[email protected]
- name: Check DB schema
run: |
DB_ID=$(yq --output-format json wrangler.toml | jq --raw-output --exit-status '.d1_databases | first | .database_id')
npm run database:migrate -- --local
sqlite3def --enable-drop-table --config sqldef.yml --dry-run \
".wrangler/state/v3/d1/${DB_ID:?}/db.sqlite" < schema.sql | head -n 1 | grep -E '^-- Nothing is modified --$'
test-ui:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4
with:
node-version-file: .node-version
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Run App in the background
run: npm run ci-dev-test-ui &
- name: Store Playwright version
run: |
PLAYWRIGHT_VERSION=$(pnpm ls @playwright/test --json | jq --exit-status --raw-output 'first | .devDependencies["@playwright/test"].version')
echo "Playwright version: ${PLAYWRIGHT_VERSION}"
echo "PLAYWRIGHT_VERSION=${PLAYWRIGHT_VERSION}" >> $GITHUB_ENV
- name: Cache Playwright
id: cache-playwright-browsers
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4
with:
path: /home/runner/.cache/ms-playwright
key: playwright-browsers-${{ runner.os }}-${{ runner.arch }}-${{ env.PLAYWRIGHT_VERSION }}
- name: Download Playwright browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test
- uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30