forked from MetaMask/metamask-docs
-
Notifications
You must be signed in to change notification settings - Fork 2
137 lines (128 loc) · 3.47 KB
/
Copy pathci.yml
File metadata and controls
137 lines (128 loc) · 3.47 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
---
name: ci
on:
workflow_call:
pull_request:
branches:
- main
permissions:
contents: read
env:
SEGMENT_ANALYTICS_KEY: ${{ secrets.SEGMENT_ANALYTICS_KEY }}
LD_CLIENT_ID: ${{ secrets.LD_CLIENT_ID }}
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Build
uses: ConsenSys/github-actions/docs-build@main
case:
name: Check for case being inconsistent
runs-on: ubuntu-latest
strategy:
matrix:
folder: ['docs']
steps:
- uses: actions/checkout@v6
- name: Case check action
uses: ConsenSys/github-actions/docs-case-check@main
with:
DOC_DIR: ${{ matrix.folder }}
SKIP_TEST: true
lint:
name: Lint Code Base
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Lint
uses: ConsenSys/github-actions/docs-lint-all@main
prettier:
name: Prettier
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Changed files (Prettier)
id: changed-files
uses: tj-actions/changed-files@22103cc46bda19c2b464ffe86db46df6922fd323 # 47.0.5; pin matches docs-spelling-check
with:
separator: "\n"
files: |
**/*.md
**/*.mdx
**/*.ts
**/*.tsx
**/*.js
**/*.jsx
**/*.json
**/*.css
**/*.scss
**/*.html
**/*.yml
**/*.yaml
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
cache: npm
- name: Install dependencies
run: npm ci
env:
NODE_ENV: development
HUSKY: 0
- name: Check formatting
if: steps.changed-files.outputs.any_changed == 'true'
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
set -euo pipefail
files_to_check=()
while IFS= read -r f || [ -n "$f" ]; do
[ -z "$f" ] && continue
if [ -f "$f" ]; then
files_to_check+=("$f")
fi
done <<< "$ALL_CHANGED_FILES"
if [ ${#files_to_check[@]} -eq 0 ]; then
echo "No existing files to check (skipping)."
exit 0
fi
./node_modules/.bin/prettier --check "${files_to_check[@]}"
- name: No Prettier-scoped files changed
if: steps.changed-files.outputs.any_changed != 'true'
run: echo "No matching changed files; Prettier check skipped."
spelling:
name: Spelling
runs-on: ubuntu-latest
strategy:
matrix:
file-extensions: ['.md', '.mdx']
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Vale
uses: Consensys/github-actions/docs-spelling-check@main
linkCheck:
name: Link Checking
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
- name: Install dependencies
run: npm ci
env:
NODE_ENV: development
HUSKY: 0
- name: Generate Snaps API reference
run: npm run docusaurus snaps:generate
- name: LinkCheck
uses: ConsenSys/github-actions/docs-link-check@main
with:
CONFIG_FILE: '.linkspector.yml'