Skip to content

⬆️: Update Tools #227

⬆️: Update Tools

⬆️: Update Tools #227

Workflow file for this run

name: Documents
on:
push:
branches:
- main
pull_request:
branches:
- main
paths:
- 'docs/**'
types:
- opened
- synchronize
- reopened
jobs:
textlint:
name: Run lint
runs-on: ubuntu-latest
env:
REVIEWDOG_GITHUB_API_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
steps:
- name: Checkout
uses: actions/checkout@v2
# Cache '.npm' to speed up clean-install when package-lock.json is updated.
# Loosened up the restore-keys a bit, as it doesn't have to match the contents of package-lock.json exactly.
- name: Cache .npm
id: cache-npm
uses: actions/cache@v2
with:
path: ~/.npm
# If cache is corrupted, increment prefixed number.
key: 1-${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
1-${{ runner.os }}-npm-
# If package-lock.json matches, node_modules will also match.
# So, cache node_modules directly to skip install step.
- name: Cache node_modules
id: cache-textlint-modules
uses: actions/cache@v2
with:
path: docs/.textlint/node_modules
# If cache is corrupted, increment prefixed number.
key: 1-${{ runner.os }}-textlint-node-modules-${{ hashFiles('docs/.textlint/package-lock.json') }}
# node_modulesがキャッシュから復元されなかった場合は、依存ライブラリをインストールします。
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm clean-install --prefix=docs/.textlint
- name: Set up reviewdog
uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest
- name: Lint (textlint)
if: always()
run: |
npm run -s lint:text --prefix=docs/.textlint | reviewdog -tee -fail-on-error -reporter=github-pr-review -f=eslint -name="textlint"
- name: Lint (MarkdownLint)
if: always()
run: |
npm run -s lint:md --prefix=docs/.textlint | reviewdog -tee -fail-on-error -reporter=github-pr-review -efm="%s:%l:%c %m" -name="markdownlint"