-
Notifications
You must be signed in to change notification settings - Fork 118
60 lines (49 loc) · 1.82 KB
/
lint.yml
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
name: Lint
on:
- push
- pull_request
jobs:
textlint:
strategy:
matrix:
os:
- ubuntu-latest
node-version:
- 14.x
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
- name: Get the number of processors currently available
id: processors
run: echo "::set-output name=number::$(getconf _NPROCESSORS_ONLN)"
- name: Get yarn cache directory path
id: yarn
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Restore yarn cache
uses: actions/cache@v2
with:
path: ${{ steps.yarn.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Setup reviewdog
run: |
mkdir -p $HOME/bin && curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b $HOME/bin
echo "$HOME/bin" >> $GITHUB_PATH
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH # for Go projects
- name: Install dependencies
run: yarn --frozen-lockfile
env:
CHILD_CONCURRENCY: ${{ steps.processors.outputs.number }}
NETWORK_CONCURRENCY: ${{ steps.processors.outputs.number }}
- name: textlint
run: yarn textlint ${FILES} -f checkstyle --experimental --parallel --max-concurrency ${{ steps.processors.outputs.number }} | reviewdog -f=checkstyle -name="textlint" -reporter=github-pr-review -level=${LEVEL}
env:
FILES: README.md docs/**/*.md
LEVEL: error
REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }}