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
11 changes: 0 additions & 11 deletions .github/workflows/api-ci.yml

This file was deleted.

51 changes: 0 additions & 51 deletions .github/workflows/reusable-api-ci.yml

This file was deleted.

2 changes: 1 addition & 1 deletion components/web/src/app/new-prompt/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export default function ChatPage() {
const handleKeyPress = (e: React.KeyboardEvent) => {
if (e.key === "Enter" && !e.shiftKey) {
e.preventDefault();
handleSubmit(e as any);
handleSubmit(e);
}
};

Expand Down
90 changes: 90 additions & 0 deletions exercices/exercice02-node-ci/exercise02-node-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Monorepo workflow

on:
pull_request:

permissions:
contents: read

env:
NODE_VERSION: "20"
NODE_PACKAGE_MANAGER: "npm"

jobs:
api:
name: Install and build the api component
runs-on: ubuntu-latest
timeout-minutes: 15
defaults:
run:
working-directory: ${{github.workspace}}/components/api

steps:
- name: Checkout the repo
uses: actions/checkout@v4

- name: Use node version 20
uses: actions/setup-node@v4
with:
node-version: ${{env.NODE_VERSION}}
cache: ${{env.NODE_PACKAGE_MANAGER}}
cache-dependency-path: "components/api/package-lock.json"

- name: Install API component Dependencies
run: npm ci

- name: Build the API component
run: npm run build

web:
name: Install, lint and build web NextJS component
runs-on: ubuntu-latest
timeout-minutes: 15
defaults:
run:
working-directory: ${{github.workspace}}/components/web

steps:
- name: Checkout the repo
uses: actions/checkout@v4

- name: Use node version 20
uses: actions/setup-node@v4
with:
node-version: ${{env.NODE_VERSION}}
cache: ${{env.NODE_PACKAGE_MANAGER}}
cache-dependency-path: "components/web/package-lock.json"

- name: Install Project Dependencies
run: npm ci

- name: Check lint errors
run: npm run lint

- name: Build web component
run: npm run build

core:
name: Install, and build the Core nodeJS component
runs-on: ubuntu-latest
timeout-minutes: 15
defaults:
run:
working-directory: ${{github.workspace}}/components/core

steps:
- name: Checkout the repo
uses: actions/checkout@v4

- name: Use node version 20
uses: actions/setup-node@v4
with:
node-version: ${{env.NODE_VERSION}}
cache: ${{env.NODE_PACKAGE_MANAGER}}
cache-dependency-path: components/core/package-lock.json

- name: Install Core Dependencies
run: npm ci

- name: Build Core component
run: npm run build
2 changes: 1 addition & 1 deletion exercices/exercice02-node-ci/instruction.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Build a basic CI that validates all packages in this repo.

## You will create

- `.github/workflows/exercice02-node-ci.yml`
- `.github/workflows/exercise02-node-ci.yml`

## Requirements

Expand Down
10 changes: 10 additions & 0 deletions exercices/exercice02-node-ci/theory.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,13 @@
- Running `npm ci` at the repo root instead of inside each package directory.
- Sharing one cache key across packages (causes incorrect hits/misses).
- Treating lint/build requirements as “global” when they’re package-specific.

## Notes

##### `timeout-minutes`

- Prevents a job from hanging forever (useful if npm ci stalls, network issues, etc.). Not required, but good hygiene.

##### `defaults.run.working-directory`

it sets a default working directory for all run: steps in that job.