Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/CI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Continuous Integration

## Overview
This project uses GitHub Actions for continuous integration. The CI workflow runs automatically on all pull requests and pushes to the `main` branch.

## CI Workflow
The CI workflow (`.github/workflows/ci.yml`) runs the following checks in sequence:

1. **Install dependencies** - `yarn install --frozen-lockfile`
2. **Test** - `yarn test` - Runs all unit tests (currently 39 tests)
3. **Build** - `yarn build` - Verifies all packages build successfully

All checks must pass before code can be merged to `main`.

> **Note:** Linting and type checking will be added after resolving existing type errors and migrating to Biome.

## Environment
- **Node version:** 22.20.0
- **Yarn version:** 1.22.18
- **OS:** Ubuntu (latest)

## Running CI Checks Locally
Before pushing your changes, you can run the same checks locally:

```bash
# Run all checks
yarn install --frozen-lockfile
yarn test
yarn build

# Or run them individually as needed
```

## Troubleshooting

### yarn.lock out of sync
If CI fails with a frozen lockfile error:
1. Make sure you've committed your `yarn.lock` file
2. Run `yarn install` locally and commit the updated `yarn.lock`
3. Never manually edit `yarn.lock`

### Test failures
Run `yarn test` locally to debug failing tests. For watch mode during development, use `yarn tdd`.

### Build failures
Run `yarn build` locally to reproduce build issues.

## Branch Protection
The `main` branch is protected and requires:
- All CI checks to pass
- Pull request reviews (if configured)
- Branches to be up to date before merging

## Adding New Checks
To add additional CI checks, edit `.github/workflows/ci.yml` and add new steps under the `steps` section.

42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
ci:
name: CI
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22.20.0'
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Setup Nx cache
uses: actions/cache@v3
with:
path: .nx/cache
key: ${{ runner.os }}-nx-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-nx-

- name: Test
run: yarn test

- name: Build
run: yarn build

5 changes: 2 additions & 3 deletions nx.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
{
"tasksRunnerOptions": {
"default": {
"runner": "@nrwl/nx-cloud",
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": [
"build",
"test",
"test-storybook",
"test-storyshots",
"typecheck"
],
"accessToken": "${NX_ACCESS_TOKEN}"
]
}
}
},
Expand Down
13 changes: 13 additions & 0 deletions packages/recommendation-block/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"compilerOptions": {
"target": "es5",
"module": "ESNext",
"strict": false,
"esModuleInterop": true,
"allowJs": true,
"outDir": "./dist",
"moduleResolution": "node",
"skipLibCheck": true
},
"include": ["src/**/*"]
}