Skip to content

Commit 6c8c518

Browse files
committed
feat: updated github actions to match new repo structure
1 parent 9015f28 commit 6c8c518

2 files changed

Lines changed: 68 additions & 11 deletions

File tree

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: 'API: Extract Public Typings'
2+
3+
# 📘 This workflow verifies that API typings can be generated and rolled up cleanly.
4+
# It runs on:
5+
# - Pushes to `main` or `next` (validate committed state)
6+
# - PRs to any branch (validate incoming changes)
7+
8+
on:
9+
push:
10+
branches:
11+
- main
12+
- next
13+
pull_request:
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
extract-api-typings:
21+
name: 📤 Extract API Typings
22+
runs-on: ubuntu-latest
23+
24+
defaults:
25+
run:
26+
working-directory: './api' # Ensure the workflow runs in the 'api' folder
27+
28+
steps:
29+
- name: ✅ Checkout Repository
30+
uses: actions/checkout@v4
31+
32+
- name: 🛠 Setup Node.js Environment
33+
uses: actions/setup-node@v4
34+
with:
35+
node-version-file: .nvmrc
36+
cache: 'npm'
37+
38+
- name: 💾 Restore npm Cache
39+
uses: actions/cache@v3
40+
with:
41+
path: ~/.npm
42+
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
43+
restore-keys: |
44+
${{ runner.os }}-node-
45+
46+
- name: 📦 Install Dependencies (npm ci)
47+
run: npm ci
48+
49+
- name: 🧬 Run API Extractor
50+
run: npm run api-extractor

.github/workflows/main.yml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,33 @@ name: Node PR Lint, Build and Test
22

33
# This workflow handles three scenarios:
44
#
5-
# 1. Push to `dev/*` branches:
5+
# 1. Push to `next`, `dev/*`, or `feature/*` branches:
66
# - Runs `code-quality-and-tests` and `integration-tests`
7-
# - Skips `build-and-package` to save time
7+
# - Skips `build-and-package` to save resources and focus on code quality
88
#
9-
# 2. Pull Requests to `main` (or rel/*):
9+
# 2. Pull Requests to `main` or `next`:
1010
# - Runs all jobs: code checks, tests, and packaging
11-
# - Used for full validation before merge
11+
# - Ensures complete validation including artifact generation before merge
1212
#
13-
# 3. Push to `main` or `rel/*`:
14-
# - Runs full workflow (same as PRs)
13+
# 3. Push to `main`:
14+
# - Runs full workflow for release validation and artifact generation
1515

1616
on:
1717
workflow_dispatch:
1818

1919
push:
2020
branches:
2121
- main
22-
- rel/*
22+
- next
2323
- dev/*
24+
- feature/*
2425

2526
pull_request:
2627
branches:
2728
- main
28-
- rel/*
29+
- next
2930
- dev/*
31+
- feature/*
3032

3133
concurrency:
3234
group: ${{ github.head_ref || github.run_id }}
@@ -102,14 +104,19 @@ jobs:
102104
- name: 🔄 Run Integration Tests (Headless UI)
103105
run: xvfb-run -a npm test
104106

105-
# Run only on push to `main` or for any PR (to any branch)
106-
# Skip on direct pushes to `dev/*` branches
107+
# Run only on push to `main` or for PRs to main or next
108+
# Skip on direct pushes to `next`, `dev/*`, and `feature/*` branches
107109
build-and-package:
108110
name: Build & Package Artifacts
109111
runs-on: ubuntu-latest
110112
needs: [code-quality-and-tests, integration-tests]
111113

112-
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/pull/')
114+
if: |
115+
github.ref == 'refs/heads/main' ||
116+
(startsWith(github.ref, 'refs/pull/') && (
117+
github.base_ref == 'main' ||
118+
github.base_ref == 'next'
119+
))
113120
114121
defaults:
115122
run:

0 commit comments

Comments
 (0)