Skip to content

Commit 627e627

Browse files
committed
feat(ci): add GitHub Actions pipeline with quality checks
Add continuous integration workflow that runs on all PRs and pushes to main. The pipeline validates code quality through five sequential checks: install dependencies, lint, typecheck, test, and build.
1 parent a5f1289 commit 627e627

File tree

2 files changed

+108
-0
lines changed

2 files changed

+108
-0
lines changed

.github/CI.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Continuous Integration
2+
3+
## Overview
4+
This project uses GitHub Actions for continuous integration. The CI workflow runs automatically on all pull requests and pushes to the `main` branch.
5+
6+
## CI Workflow
7+
The CI workflow (`.github/workflows/ci.yml`) runs the following checks in sequence:
8+
9+
1. **Install dependencies** - `yarn install --frozen-lockfile`
10+
2. **Type check** - `yarn typecheck` - Validates TypeScript types across all packages
11+
3. **Test** - `yarn test` - Runs all unit tests (currently 39 tests)
12+
4. **Build** - `yarn build` - Verifies all packages build successfully
13+
14+
All checks must pass before code can be merged to `main`.
15+
16+
> **Note:** Linting will be added in a future update when migrating to Biome.
17+
18+
## Environment
19+
- **Node version:** 22.20.0
20+
- **Yarn version:** 1.22.18
21+
- **OS:** Ubuntu (latest)
22+
23+
## Running CI Checks Locally
24+
Before pushing your changes, you can run the same checks locally:
25+
26+
```bash
27+
# Run all checks
28+
yarn install --frozen-lockfile
29+
yarn typecheck
30+
yarn test
31+
yarn build
32+
33+
# Or run them individually as needed
34+
```
35+
36+
## Troubleshooting
37+
38+
### yarn.lock out of sync
39+
If CI fails with a frozen lockfile error:
40+
1. Make sure you've committed your `yarn.lock` file
41+
2. Run `yarn install` locally and commit the updated `yarn.lock`
42+
3. Never manually edit `yarn.lock`
43+
44+
### Test failures
45+
Run `yarn test` locally to debug failing tests. For watch mode during development, use `yarn tdd`.
46+
47+
### Type check failures
48+
Run `yarn typecheck` locally to see TypeScript errors.
49+
50+
### Build failures
51+
Run `yarn build` locally to reproduce build issues.
52+
53+
## Branch Protection
54+
The `main` branch is protected and requires:
55+
- All CI checks to pass
56+
- Pull request reviews (if configured)
57+
- Branches to be up to date before merging
58+
59+
## Adding New Checks
60+
To add additional CI checks, edit `.github/workflows/ci.yml` and add new steps under the `steps` section.
61+

.github/workflows/ci.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
ci:
13+
name: CI
14+
runs-on: ubuntu-latest
15+
env:
16+
NX_CLOUD_DISTRIBUTED_EXECUTION: false
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: '22.20.0'
26+
cache: 'yarn'
27+
28+
- name: Install dependencies
29+
run: yarn install --frozen-lockfile
30+
31+
- name: Setup Nx cache
32+
uses: actions/cache@v3
33+
with:
34+
path: .nx/cache
35+
key: ${{ runner.os }}-nx-${{ hashFiles('**/yarn.lock') }}
36+
restore-keys: |
37+
${{ runner.os }}-nx-
38+
39+
- name: Type check
40+
run: yarn typecheck
41+
42+
- name: Test
43+
run: yarn test
44+
45+
- name: Build
46+
run: yarn build
47+

0 commit comments

Comments
 (0)