Skip to content

Commit

Permalink
Refactor linting into linting action
Browse files Browse the repository at this point in the history
  • Loading branch information
Nolski committed Feb 17, 2025
1 parent 0019a4f commit ba402f6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 39 deletions.
33 changes: 1 addition & 32 deletions .github/workflows/deploy-book.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
name: deploy-book

# Run this when the master or main branch changes
# Runs on main branch changes or manual dispatch
on:
workflow_dispatch:
push:
branches:
- main
# If your git repository has the Jupyter Book within some-subfolder next to
# unrelated files, you can make this run only if a file within that specific
# folder has been modified.
#
# paths:
# - some-subfolder/**

# This job installs dependencies, builds the book, and pushes it to `gh-pages`
jobs:
Expand All @@ -29,35 +23,10 @@ jobs:
with:
python-version: 3.11

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'

- name: Node install
run: |
npm install
npm install -g markdownlint-cli
markdownlint --help
- name: Install dependencies
run: |
pip install -r requirements.txt
# (optional) Cache your executed notebooks between runs
# if you have config:
# execute:
# execute_notebooks: cache
- name: cache executed notebooks
uses: actions/cache@v3
with:
path: _build/.jupyter_cache
key: jupyter-book-cache-${{ hashFiles('requirements.txt') }}

- name: Lint
run: |
npm run run-all
# Build the book
- name: Build the book
run: |
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/link-check.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Check Links
name: Lint Markdown and check links
on:
push:
pull_request:
branches:
- main

Expand All @@ -15,11 +15,14 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v3
with:
# I had an issue here where the node-version needed to be above '14'
node-version: '18'

- name: Install Dependencies
run: npm install -g markdown-link-check

- name: Check Links
run: markdown-link-check -q ./*.md -c mdlinkcheckconfig.json && markdown-link-check ./**/*.md -q -c mdlinkcheckconfig.json
run: |
npm install
npm install -g markdownlint-cli
npm install -g markdown-link-check
- name: Lint markdown
run: npm run lint
- name: Link check
run: npm run links-ci

0 comments on commit ba402f6

Please sign in to comment.