-
-
Notifications
You must be signed in to change notification settings - Fork 2k
163 lines (154 loc) · 4.64 KB
/
Copy pathci.yml
File metadata and controls
163 lines (154 loc) · 4.64 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
---
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
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Checkout Vale config
uses: actions/checkout@v6
with:
repository: Consensys/github-actions
path: .github-actions
- name: Changed files
id: changed-files
uses: tj-actions/changed-files@22103cc46bda19c2b464ffe86db46df6922fd323 # 47.0.5; pin matches docs-spelling-check
with:
path: .
files: |
**/*.md
**/*.mdx
separator: ','
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: '3.12'
# Use reporter: local so reviewdog does not fetch the PR diff. Large PRs (for example
# bulk deletions) exceed GitHub's 300-file diff limit and break github-pr-check.
- name: Vale
if: steps.changed-files.outputs.any_changed == 'true'
uses: errata-ai/vale-action@d89dee975228ae261d22c15adcd03578634d429c # v2.1.1
with:
files: ${{ steps.changed-files.outputs.all_changed_files }}
vale_flags: '--config .github-actions/docs-spelling-check/.vale.ini'
reporter: local
fail_on_error: true
separator: ','
- name: No spelling-scoped files changed
if: steps.changed-files.outputs.any_changed != 'true'
run: echo 'No matching changed files; Vale check skipped.'
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'