Skip to content

Commit 3cc95c3

Browse files
authored
feat(ci): add GitHub Actions pipeline with quality checks (#23)
Closes #19 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 c41a414 commit 3cc95c3

File tree

4 files changed

+113
-3
lines changed

4 files changed

+113
-3
lines changed

.github/CI.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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. **Test** - `yarn test` - Runs all unit tests (currently 39 tests)
11+
3. **Build** - `yarn build` - Verifies all packages build successfully
12+
13+
All checks must pass before code can be merged to `main`.
14+
15+
> **Note:** Linting and type checking will be added after resolving existing type errors and migrating to Biome.
16+
17+
## Environment
18+
- **Node version:** 22.20.0
19+
- **Yarn version:** 1.22.18
20+
- **OS:** Ubuntu (latest)
21+
22+
## Running CI Checks Locally
23+
Before pushing your changes, you can run the same checks locally:
24+
25+
```bash
26+
# Run all checks
27+
yarn install --frozen-lockfile
28+
yarn test
29+
yarn build
30+
31+
# Or run them individually as needed
32+
```
33+
34+
## Troubleshooting
35+
36+
### yarn.lock out of sync
37+
If CI fails with a frozen lockfile error:
38+
1. Make sure you've committed your `yarn.lock` file
39+
2. Run `yarn install` locally and commit the updated `yarn.lock`
40+
3. Never manually edit `yarn.lock`
41+
42+
### Test failures
43+
Run `yarn test` locally to debug failing tests. For watch mode during development, use `yarn tdd`.
44+
45+
### Build failures
46+
Run `yarn build` locally to reproduce build issues.
47+
48+
## Branch Protection
49+
The `main` branch is protected and requires:
50+
- All CI checks to pass
51+
- Pull request reviews (if configured)
52+
- Branches to be up to date before merging
53+
54+
## Adding New Checks
55+
To add additional CI checks, edit `.github/workflows/ci.yml` and add new steps under the `steps` section.
56+

.github/workflows/ci.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: '22.20.0'
24+
cache: 'yarn'
25+
26+
- name: Install dependencies
27+
run: yarn install --frozen-lockfile
28+
29+
- name: Setup Nx cache
30+
uses: actions/cache@v3
31+
with:
32+
path: .nx/cache
33+
key: ${{ runner.os }}-nx-${{ hashFiles('**/yarn.lock') }}
34+
restore-keys: |
35+
${{ runner.os }}-nx-
36+
37+
- name: Test
38+
run: yarn test
39+
40+
- name: Build
41+
run: yarn build
42+

nx.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
{
22
"tasksRunnerOptions": {
33
"default": {
4-
"runner": "@nrwl/nx-cloud",
4+
"runner": "nx/tasks-runners/default",
55
"options": {
66
"cacheableOperations": [
77
"build",
88
"test",
99
"test-storybook",
1010
"test-storyshots",
1111
"typecheck"
12-
],
13-
"accessToken": "${NX_ACCESS_TOKEN}"
12+
]
1413
}
1514
}
1615
},
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es5",
4+
"module": "ESNext",
5+
"strict": false,
6+
"esModuleInterop": true,
7+
"allowJs": true,
8+
"outDir": "./dist",
9+
"moduleResolution": "node",
10+
"skipLibCheck": true
11+
},
12+
"include": ["src/**/*"]
13+
}

0 commit comments

Comments
 (0)