From ba402f67d3fc8c1baf4840a608e968fd48f5a246 Mon Sep 17 00:00:00 2001 From: Mike Nolan Date: Mon, 17 Feb 2025 15:24:30 +0000 Subject: [PATCH] Refactor linting into linting action --- .github/workflows/deploy-book.yml | 33 +------------------------------ .github/workflows/link-check.yml | 17 +++++++++------- 2 files changed, 11 insertions(+), 39 deletions(-) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index 136b7a9..594186a 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -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: @@ -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: | diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml index 16f7bf4..6d045f5 100644 --- a/.github/workflows/link-check.yml +++ b/.github/workflows/link-check.yml @@ -1,6 +1,6 @@ -name: Check Links +name: Lint Markdown and check links on: - push: + pull_request: branches: - main @@ -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 \ No newline at end of file + 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