ci: setup docs prose linting with vale
- only deploy if prose lint passes - rework styles download - add vale anotations matcher - set MinAlertLevel to warning - add website pages to the prose linter - do not fail on docs linting
This commit is contained in:
parent
2d644561bf
commit
75e3760f2e
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"problemMatcher": [
|
||||
{
|
||||
"severity": "error",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^([^:]+):(\\d+):(\\d+):([^:]+):(.*)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"code": 4,
|
||||
"message": 5
|
||||
}
|
||||
],
|
||||
"owner": "vale-error"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
*
|
||||
!Makefile
|
||||
!LibreTime
|
||||
!Vocab
|
|
@ -0,0 +1,6 @@
|
|||
extends: substitution
|
||||
message: Consider using '%s'
|
||||
level: warning
|
||||
ignorecase: false
|
||||
swap:
|
||||
Libretime: LibreTime
|
|
@ -0,0 +1,18 @@
|
|||
.PHONY: all
|
||||
|
||||
SHELL = bash
|
||||
|
||||
%.zip:
|
||||
wget -q $(URL) -O $@
|
||||
|
||||
Google.zip: URL=https://github.com/errata-ai/Google/releases/latest/download/Google.zip
|
||||
Microsoft.zip: URL=https://github.com/errata-ai/Microsoft/releases/latest/download/Microsoft.zip
|
||||
|
||||
%: %.zip
|
||||
unzip -qq $<
|
||||
touch $@
|
||||
|
||||
STYLES := ./Microsoft ./Google
|
||||
STYLES_ZIP := $(addsuffix .zip,$(STYLES))
|
||||
|
||||
all: $(STYLES)
|
|
@ -10,12 +10,36 @@ on:
|
|||
pull_request:
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Lint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install Vale
|
||||
run: |
|
||||
sudo pip3 install gh-release-install
|
||||
sudo gh-release-install \
|
||||
errata-ai/vale \
|
||||
vale_{version}_Linux_64-bit.tar.gz --extract vale \
|
||||
/usr/local/bin/vale
|
||||
|
||||
- name: Add annotations matchers
|
||||
run: |
|
||||
echo "::add-matcher::.github/annotations/vale.json"
|
||||
|
||||
- name: Run Vale
|
||||
run: |
|
||||
make -C .github/vale/styles
|
||||
vale --output line docs website/src/pages || true
|
||||
|
||||
deploy:
|
||||
name: Deploy
|
||||
runs-on: ubuntu-latest
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
|
||||
needs: [lint]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
StylesPath = .github/vale/styles
|
||||
MinAlertLevel = warning
|
||||
|
||||
Vocab = Docs
|
||||
|
||||
[*.md]
|
||||
BasedOnStyles = Vale, Google, Microsoft, LibreTime
|
Loading…
Reference in New Issue