Replace CI lint jobs with backend, frontend, and e2e test jobs
Lint, formatting, and type checks are already enforced by prek pre-commit hooks, so CI now focuses on running the actual test suites instead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
82
.github/workflows/ci.yml
vendored
82
.github/workflows/ci.yml
vendored
@@ -22,40 +22,39 @@ permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
backend-lint:
|
||||
backend-tests:
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
ports:
|
||||
- 5433:5432
|
||||
env:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_DB: nuzlocke_test
|
||||
options: >-
|
||||
--health-cmd "pg_isready -U postgres"
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
steps:
|
||||
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
|
||||
- uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
|
||||
with:
|
||||
python-version: "3.14"
|
||||
- run: pip install ruff ty
|
||||
- name: Check linting
|
||||
run: ruff check backend/
|
||||
- name: Check formatting
|
||||
run: ruff format --check backend/
|
||||
- name: Type check
|
||||
run: ty check backend/src/
|
||||
continue-on-error: true
|
||||
- name: Install dependencies
|
||||
run: uv pip install --system -e ".[dev]"
|
||||
working-directory: backend
|
||||
- name: Run tests
|
||||
run: pytest -q
|
||||
working-directory: backend
|
||||
env:
|
||||
TEST_DATABASE_URL: postgresql+asyncpg://postgres:postgres@localhost:5433/nuzlocke_test
|
||||
|
||||
actions-lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Install actionlint
|
||||
run: |
|
||||
bash <(curl -sL https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
|
||||
sudo mv actionlint /usr/local/bin/
|
||||
- name: Lint GitHub Actions
|
||||
run: actionlint
|
||||
- name: Audit GitHub Actions security
|
||||
run: pipx run zizmor .github/workflows/
|
||||
|
||||
frontend-lint:
|
||||
frontend-tests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
||||
@@ -67,12 +66,31 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
working-directory: frontend
|
||||
- name: Lint
|
||||
run: npm run lint
|
||||
- name: Run tests
|
||||
run: npm test
|
||||
working-directory: frontend
|
||||
- name: Check formatting
|
||||
run: npx oxfmt --check "src/"
|
||||
|
||||
e2e-tests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
with:
|
||||
node-version: "24"
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
working-directory: frontend
|
||||
- name: Type check
|
||||
run: npx tsc -b
|
||||
- name: Install Playwright browsers
|
||||
run: npx playwright install --with-deps chromium
|
||||
working-directory: frontend
|
||||
- name: Run e2e tests
|
||||
run: npm run test:e2e
|
||||
working-directory: frontend
|
||||
- name: Upload Playwright report
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: playwright-report
|
||||
path: frontend/playwright-report/
|
||||
|
||||
Reference in New Issue
Block a user