Skip to content

Commit

Permalink
ci: migrate to anycable's docs-lint
Browse files Browse the repository at this point in the history
  • Loading branch information
palkan committed Nov 14, 2023
1 parent 1efd130 commit 8601e25
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 70 deletions.
76 changes: 9 additions & 67 deletions .github/workflows/docs-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,76 +5,18 @@ on:
branches:
- master
paths:
- ".github/**/*.yml"
- "**/*.md"
- "**/*.html"
- ".github/workflows/docs-lint.yml"
- ".yaspellerrc"
pull_request:
paths:
- ".github/**/*.yml"
- "**/*.md"
- "**/*.html"
- ".github/workflows/docs-lint.yml"
- ".yaspellerrc"

jobs:
markdownlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Run Markdown linter
run: |
gem install mdl
mdl docs
rubocop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Lint Markdown files with RuboCop
run: |
gem install bundler
bundle install --gemfile gemfiles/rubocop.gemfile --jobs 4 --retry 3
bundle exec --gemfile gemfiles/rubocop.gemfile rubocop
forspell:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Hunspell
run: |
sudo apt-get install hunspell
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Cache installed gems
uses: actions/cache@v1
with:
path: /home/runner/.rubies/ruby-2.7.0/lib/ruby/gems/2.7.0
key: gems-cache-${{ runner.os }}
- name: Install Forspell
run: gem install forspell
- name: Run Forspell
run: forspell docs/

liche:
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.13.x
- name: Install liche
run: |
export PATH=$PATH:$(go env GOPATH)/bin
go get -u github.com/raviqqe/liche
- name: Run liche
run: |
export PATH=$PATH:$(go env GOPATH)/bin
liche -c 2 -r docs/* -d docs/ -x "(assets)/"
docs-lint:
uses: anycable/github-actions/.github/workflows/docs-lint.yml@master
with:
mdl-path: "*.md"
lychee-args: docs/* --exclude "(assets)/"
File renamed without changes.
6 changes: 6 additions & 0 deletions forspell.dict
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,9 @@ Flamegraph
Spier
Isolator
atomicity
Bootsnap
Webmock
utils
misconfigured
Inlined
Wisper
6 changes: 3 additions & 3 deletions lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ pre-commit:
tags: style
glob: "**/*.md"
run: mdl {staged_files}
liche:
lychee:
tags: links
glob: "docs/*.md"
run: liche -c 2 -r docs/* -d docs/ -x "(assets)/" && test {staged_files}
run: lychee docs/*.md --exclude "(assets)/" && test {staged_files}
forspell:
tags: grammar
glob: "**/*.md"
run: forspell {staged_files}
rubocop:
tags: style
glob: "**/*.md"
run: BUNDLE_GEMFILE=gemfiles/rubocop.gemfile bundle exec rubocop {staged_files}
run: BUNDLE_GEMFILE=gemfiles/rubocop.gemfile bundle exec rubocop -c .rubocop-md.yml {staged_files}

0 comments on commit 8601e25

Please sign in to comment.