chore: Switch DocTOC build to GitHub Actions

Only executes when the TOC files have changed.
Now also checks BestPractices.md
This commit is contained in:
Nick Schonning 2020-01-01 00:20:27 -05:00
parent be6e86a7f6
commit 24fcebb195
3 changed files with 27 additions and 22 deletions

27
.github/workflows/doctoc.yml vendored Normal file
View File

@ -0,0 +1,27 @@
name: Check generated TOCs
on:
pull_request:
paths:
- "README.md"
- "docs/BestPractices.md"
jobs:
doctoc:
name: Doc TOC Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Install doctoc
run: npm i -g doctoc
- name: Create README copy and diff with doctoc
run: cp README.md README.md.tmp &&
doctoc --title='## Table of Contents' --github README.md &&
diff -q README.md README.md.tmp
- name: Create "docs/BestPractices.md" copy and diff with doctoc
run: cp docs/BestPractices.md docs/BestPractices.md.tmp &&
doctoc --title='## Table of Contents' --github docs/BestPractices.md &&
diff -q docs/BestPractices.md docs/BestPractices.md.tmp

View File

@ -57,17 +57,6 @@ jobs:
script:
- find . -name "*.md" | xargs -n 1 markdown-link-check
- stage: Test
name: Doc Toc Check
language: node_js
node_js:
- lts/*
install: npm i -g doctoc
script:
- cp README.md README.md.tmp &&
doctoc --title='## Table of Contents' --github README.md &&
diff -q README.md README.md.tmp
- stage: Test
name: shfmt check
script:

View File

@ -55,17 +55,6 @@ jobs:
script:
- find . -name "*.md" | xargs -n 1 markdown-link-check
- stage: Test
name: Doc Toc Check
language: node_js
node_js:
- lts/*
install: npm i -g doctoc
script:
- cp README.md README.md.tmp &&
doctoc --title='## Table of Contents' --github README.md &&
diff -q README.md README.md.tmp
- stage: Test
name: shfmt check
script: