This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
name: CI
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
checks:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: node:22-bookworm
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: https://github.com/actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Install Python and native build tools
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y --no-install-recommends python3 make g++
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
# Generates the SvelteKit config required by tests in a fresh checkout.
|
||||
- name: Check styles and types
|
||||
run: npm run check
|
||||
|
||||
- name: Check formatting and lint
|
||||
run: npm run lint
|
||||
|
||||
- name: Run application tests
|
||||
# Bound resource use for database-heavy fixtures on shared runners.
|
||||
env:
|
||||
VITEST_MAX_WORKERS: '2'
|
||||
run: npm test
|
||||
|
||||
- name: Run agent tests
|
||||
run: npm run test:agent
|
||||
|
||||
- name: Build production bundles
|
||||
run: npm run build
|
||||
@@ -83,6 +83,15 @@ npm run test:agent
|
||||
npm run build
|
||||
```
|
||||
|
||||
The [Gitea Actions workflow](../../.gitea/workflows/ci.yml) runs these checks on
|
||||
every push and pull request after `npm ci`. It uses a Node.js 22 Debian container
|
||||
with Python 3 and native build tools for `better-sqlite3`. The runner must support
|
||||
Docker jobs with the `ubuntu-latest` label. `npm run check` runs before the tests
|
||||
to generate the SvelteKit configuration needed in a fresh checkout. Application
|
||||
tests use two workers in CI to bound resource use for database-heavy fixtures.
|
||||
The build step runs the same `npm run build` command used by the Dockerfile,
|
||||
including agent packaging and the report and launch bundles.
|
||||
|
||||
Run `npm run format` to apply Prettier formatting before committing. It uses
|
||||
four-space indentation and a 100-column target for supported source, config and
|
||||
documentation files, including Svelte components. Python, shell and game scripts
|
||||
|
||||
Reference in New Issue
Block a user