-
Notifications
You must be signed in to change notification settings - Fork 274
Expand file tree
/
Copy pathdocs-sdk-code-samples-check.yml
More file actions
61 lines (50 loc) · 1.99 KB
/
docs-sdk-code-samples-check.yml
File metadata and controls
61 lines (50 loc) · 1.99 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
# Runs daily and on workflow_dispatch.
# - Job 1: Fails if local code samples are not properly used (route comment → OpenAPI, no comment → snippet in docs).
# - Job 2: Fails if any SDK has code samples not present in the local .code-samples.meilisearch.yaml.
# - Job 3: Informational only (never fails) – lists CodeSamples* import keys missing from each SDK.
name: Check Docs & SDK code sample files
on:
workflow_dispatch:
schedule:
# Every day at 06:00 UTC
- cron: '0 6 * * *'
jobs:
# Fails if a code sample's route comment doesn't match a valid OpenAPI path,
# or if a sample without a route comment isn't referenced in any doc page.
local-samples-usage:
name: Local code samples usage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Check local code samples are used
run: npm run check-code-samples-usage
# Fails if an SDK's .code-samples.meilisearch.yaml contains keys absent from
# the local .code-samples.meilisearch.yaml (those SDK samples are useless).
unused-sdk-samples:
name: Unused code samples in SDKs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: "20"
cache: "npm"
- name: Install dependencies
run: npm install
- name: Check for unused SDK code samples
run: npm run check-unused-sdk-samples
# Informational only – this job never fails.
# Lists code sample keys referenced by CodeSamples* imports in the docs that are missing from each SDK.
missing-sdk-samples:
name: "[Info only - never fails] Missing SDK code samples"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: "20"
cache: "npm"
- name: Install dependencies
run: npm install
- name: List missing SDK code samples (informational, never fails)
run: npm run check-missing-sdk-samples