-
Notifications
You must be signed in to change notification settings - Fork 3.2k
55 lines (45 loc) · 1.61 KB
/
docs-examples.yml
File metadata and controls
55 lines (45 loc) · 1.61 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
name: Check docs examples (JS version vs TS version)
on:
pull_request:
paths:
- 'docs/**'
types: [opened, synchronize, reopened]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
docs_examples:
name: Docs Examples
runs-on: ubuntu-latest
steps:
- name: Checkout the pull request merge commit
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # https://github.com/actions/checkout/releases/tag/v6.0.2
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # https://github.com/pnpm/action-setup/releases/tag/v4.2.0
name: Install pnpm
- name: Use Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # https://github.com/actions/setup-node/releases/tag/v6.2.0
with:
node-version-file: '.nvmrc'
cache: 'npm'
cache-dependency-path: docs/package-lock.json
- name: Install Documentation dependencies
run: |
cd docs/ && npm ci --no-audit
- name: Install Handsontable dependencies
run: |
pnpm install
- name: Generate JS code examples
run: |
cd docs/ && npm run docs:code-examples:generate-all-js
- name: Check if generated examples made any changes
run: |
if git diff --exit-code && git diff --cached --exit-code; then
echo "No changes detected"
else
exit 1
fi
- name: Report status
if: failure()
run: |
echo "Changes were detected. This check has failed."
exit 1