Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
build: consolidate JS and md linting GitHub Actions
Linting markdown runs the JavaScript linting job, so consolidate them to
conserve time and resources. Run JavaScript separately, but then run
markdown linting so it can use the cached results of the JavaScript
linting.
  • Loading branch information
Trott committed Apr 1, 2022
commit 939757101cf043bc681164df06cb584647b86911
22 changes: 4 additions & 18 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
run: npx envinfo
- name: Lint C/C++ files
run: make lint-cpp
lint-md:
lint-js-and-md:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
Expand All @@ -62,32 +62,18 @@ jobs:
node-version: ${{ env.NODE_VERSION }}
- name: Environment Information
run: npx envinfo
- name: Lint JavaScript files
run: NODE=$(command -v node) make lint-js
- name: Get release version numbers
if: ${{ github.event.pull_request && github.event.pull_request.base.ref == github.event.pull_request.base.repo.default_branch }}
id: get-released-versions
run: ./tools/lint-md/list-released-versions-from-changelogs.mjs
- name: Lint docs
- name: Lint markdown files
run: |
echo "::add-matcher::.github/workflows/remark-lint-problem-matcher.json"
NODE=$(command -v node) make lint-md
env:
NODE_RELEASED_VERSIONS: ${{ steps.get-released-versions.outputs.NODE_RELEASED_VERSIONS }}

lint-js:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Environment Information
run: npx envinfo
- name: Lint JavaScript files
run: NODE=$(command -v node) make lint-js
lint-py:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
Expand Down