70 lines
1.4 KiB
YAML
70 lines
1.4 KiB
YAML
name: CI Pipeline
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [main, master, develop]
|
|
types: [opened, synchronize, reopened]
|
|
push:
|
|
branches: [main, master, develop]
|
|
paths:
|
|
- 'src/**'
|
|
- 'tests/**'
|
|
- 'package.json'
|
|
- 'package-lock.json'
|
|
- 'tsconfig.json'
|
|
- '.eslintrc.json'
|
|
- '.github/workflows/**'
|
|
- '.GitLink/workflows/**'
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
lint-and-type-check:
|
|
name: Lint & Type Check
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Lint
|
|
run: npm run lint
|
|
|
|
- name: Type Check
|
|
run: npm run type-check
|
|
|
|
test:
|
|
name: Test Suite
|
|
runs-on: ubuntu-latest
|
|
needs: lint-and-type-check
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Run tests with coverage
|
|
run: npm test -- --coverage
|
|
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v4
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
fail_ci_if_error: false
|