Skip to content

Commit d9a1d78

Browse files
Trottjuanarbol
authored andcommitted
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. PR-URL: #42572 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Mestery <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Darshan Sen <[email protected]>
1 parent beffed1 commit d9a1d78

File tree

1 file changed

+4
-18
lines changed

1 file changed

+4
-18
lines changed

.github/workflows/linters.yml

+4-18
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
run: npx envinfo
5050
- name: Lint C/C++ files
5151
run: make lint-cpp
52-
lint-md:
52+
lint-js-and-md:
5353
if: github.event.pull_request.draft == false
5454
runs-on: ubuntu-latest
5555
steps:
@@ -62,32 +62,18 @@ jobs:
6262
node-version: ${{ env.NODE_VERSION }}
6363
- name: Environment Information
6464
run: npx envinfo
65+
- name: Lint JavaScript files
66+
run: NODE=$(command -v node) make lint-js
6567
- name: Get release version numbers
6668
if: ${{ github.event.pull_request && github.event.pull_request.base.ref == github.event.pull_request.base.repo.default_branch }}
6769
id: get-released-versions
6870
run: ./tools/lint-md/list-released-versions-from-changelogs.mjs
69-
- name: Lint docs
71+
- name: Lint markdown files
7072
run: |
7173
echo "::add-matcher::.github/workflows/remark-lint-problem-matcher.json"
7274
NODE=$(command -v node) make lint-md
7375
env:
7476
NODE_RELEASED_VERSIONS: ${{ steps.get-released-versions.outputs.NODE_RELEASED_VERSIONS }}
75-
76-
lint-js:
77-
if: github.event.pull_request.draft == false
78-
runs-on: ubuntu-latest
79-
steps:
80-
- uses: actions/checkout@v3
81-
with:
82-
persist-credentials: false
83-
- name: Use Node.js ${{ env.NODE_VERSION }}
84-
uses: actions/setup-node@v3
85-
with:
86-
node-version: ${{ env.NODE_VERSION }}
87-
- name: Environment Information
88-
run: npx envinfo
89-
- name: Lint JavaScript files
90-
run: NODE=$(command -v node) make lint-js
9177
lint-py:
9278
if: github.event.pull_request.draft == false
9379
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)