123 lines
2.4 KiB
YAML
123 lines
2.4 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths-ignore:
|
|
- "**.md"
|
|
- "LICENSE"
|
|
- ".gitignore"
|
|
- ".editorconfig"
|
|
- ".vscode/**"
|
|
- "docs/**"
|
|
- ".prettierrc*"
|
|
- ".eslintrc*"
|
|
- ".github/ISSUE_TEMPLATE/**"
|
|
- ".github/PULL_REQUEST_TEMPLATE/**"
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
paths-ignore:
|
|
- "**.md"
|
|
- "LICENSE"
|
|
- ".gitignore"
|
|
- ".editorconfig"
|
|
- ".vscode/**"
|
|
- "docs/**"
|
|
- ".prettierrc*"
|
|
- ".eslintrc*"
|
|
- ".github/ISSUE_TEMPLATE/**"
|
|
- ".github/PULL_REQUEST_TEMPLATE/**"
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
lint:
|
|
name: Lint
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: "20"
|
|
cache: "npm"
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Run ESLint
|
|
run: npm run lint
|
|
|
|
- name: Check formatting
|
|
run: npm run format:check
|
|
|
|
test:
|
|
name: Test and Coverage
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: "20"
|
|
cache: "npm"
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Run tests
|
|
run: npm run test:run
|
|
env:
|
|
CI: true
|
|
|
|
- name: Generate coverage report
|
|
run: npm run test:coverage
|
|
env:
|
|
CI: true
|
|
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v5
|
|
with:
|
|
files: ./coverage/lcov.info
|
|
flags: unit
|
|
name: unit-coverage
|
|
disable_search: true
|
|
fail_ci_if_error: true
|
|
verbose: true
|
|
env:
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
typecheck:
|
|
name: Type Check
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: "20"
|
|
cache: "npm"
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Run type check
|
|
run: npm run type-check
|