-
Notifications
You must be signed in to change notification settings - Fork 12
63 lines (53 loc) · 2.04 KB
/
api-extractor.yaml
File metadata and controls
63 lines (53 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: 'API: Extract Public Typings'
# 📘 This workflow verifies that API typings can be generated and rolled up cleanly.
# It runs on:
# - Pushes to `main` or `next` (validate committed state)
# - PRs to any branch (validate incoming changes)
on:
push:
branches:
- main
- next
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
extract-api-typings:
name: Extract API Typings
runs-on: ubuntu-latest
steps:
- name: ✅ Checkout Repository
uses: actions/checkout@v6
- name: 🔍 Check if API directory exists
id: check-dir
run: |
if [ ! -d "./api" ]; then
echo "::notice::API directory not found - skipping API extraction"
echo "api_exists=false" >> $GITHUB_OUTPUT
else
echo "✅ API directory found"
echo "api_exists=true" >> $GITHUB_OUTPUT
fi
- name: 🛠 Setup Node.js Environment
if: steps.check-dir.outputs.api_exists == 'true'
uses: actions/setup-node@v5
with:
node-version-file: .nvmrc
cache: 'npm'
- name: 💾 Restore npm Cache
if: steps.check-dir.outputs.api_exists == 'true'
uses: actions/cache@v5
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: 📦 Install Dependencies (npm ci)
if: steps.check-dir.outputs.api_exists == 'true'
working-directory: './api'
run: npm ci
- name: 🧬 Run API Extractor
if: steps.check-dir.outputs.api_exists == 'true'
working-directory: './api'
run: npm run api-extractor