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
70 changes: 70 additions & 0 deletions .github/workflows/fe-ci-storybook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: FRONTEND-CI-STORYBOOK

on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- dev
- main
paths:
- 'src/frontend/packages/ui/**'
- '../workflows/fe-ci-storybook.yml'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
changes:
if: ${{ github.actor != 'l10nbot' }} # Avoid running for 'l10nbot'
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- uses: pnpm/action-setup@v3
with:
version: 8

- name: Cache dependencies
uses: actions/cache/restore@v4
with:
path: |
~/.pnpm-store
**/node_modules
src/frontend/node_modules
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-

- name: Install pnpm
run: npm install -g pnpm

- name: Install dependencies
run: |
cd src/frontend
pnpm install --strict-peer-dependencies=false --no-frozen-lockfile
pnpm add turbo --save-dev -w

- name: CI
run: |
cd src/frontend
pnpm turbo typescript lint format build-storybook --parallel

required:
needs: [changes]
if: always()
runs-on: ubuntu-latest
steps:
- name: fail if conditional jobs failed
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'skipped') || contains(needs.*.result, 'cancelled')
run: exit 1
19 changes: 16 additions & 3 deletions .github/workflows/fe-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ on:
- main
paths:
- 'src/frontend/**'
- '!src/frontend/packages/ui/**'
- '../workflows/fe-ci.yml'
# push:
# branches:
# - fe-feat/ci-storybook
# paths:
# - '!src/frontend/packages/ui/**'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand All @@ -25,16 +32,22 @@ jobs:
with:
fetch-depth: 2

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- uses: pnpm/action-setup@v3
with:
version: 8

- name: Cache dependencies
uses: actions/cache@v4
uses: actions/cache/restore@v4
with:
path: |
~/.pnpm-store
node_modules
**/node_modules
src/frontend/node_modules
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
Expand All @@ -51,7 +64,7 @@ jobs:
- name: CI
run: |
cd src/frontend
pnpm turbo typescript lint format build build-storybook --parallel
pnpm turbo typescript lint format build --parallel

required:
needs: [changes]
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"lint": "eslint . --max-warnings 50",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
"build-storybook": "storybook build -o storybook-static"
},
"dependencies": {
"@radix-ui/react-avatar": "^1.1.2",
Expand Down
16 changes: 4 additions & 12 deletions src/frontend/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
"build": {
"dependsOn": ["^build"],
"inputs": ["$TURBO_DEFAULT$", ".env*"],
"outputs": ["dist/**"]
"outputs": [".next/**"]
},
"build-storybook": {
"dependsOn": ["^build"],
"dependsOn": ["^build-storybook"],
"inputs": ["$TURBO_DEFAULT$", ".env*"],
"outputs": ["packages/ui/storybook-static/**"],
"outputs": ["storybook-static/**"],
"cache": true,
"persistent": false
},
"storybook": {
"dependsOn": ["^storybook"],
"inputs": ["$TURBO_DEFAULT$", ".env*"],
"outputs": ["packages/ui/storybook-static/**"],
"outputs": ["storybook-static/**"],
"cache": true,
"persistent": false
},
Expand All @@ -27,13 +27,6 @@
"cache": false,
"persistent": false
},
"check-types": {
"dependsOn": ["^check-types"],
"inputs": ["$TURBO_DEFAULT$", "tsconfig.json", "packages/**/tsconfig.json"],
"outputs": ["packages/**/dist/**"],
"cache": true,
"persistent": false
},
"dev": {
"cache": false,
"persistent": true
Expand All @@ -47,7 +40,6 @@
"typescript": {
"dependsOn": ["^typescript"],
"inputs": ["$TURBO_DEFAULT$", "tsconfig.json", "packages/**/tsconfig.json"],
"outputs": ["packages/**/dist/**"],
"cache": true,
"persistent": false
}
Expand Down
Loading