Skip to content

Commit

Permalink
[CI] Ensure check-text GHA jobs use proper node version
Browse files Browse the repository at this point in the history
  • Loading branch information
chalin committed Apr 2, 2024
1 parent 405d7cd commit 9b688be
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions .github/workflows/check-text.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Make sure that we only install the dependencies for textlint to speed up install
- run: |
- name: Create and use reduced-dependencies package.json
run: |
mkdir -p tmp
jq '.devDependencies |= with_entries( select(.key | startswith("textlint")))
| del(.dependencies, .optionalDependencies)' \
package.json > tmp/package-min.json
cp tmp/package-min.json package.json
package.json > tmp/package-ci.json
cp tmp/package-ci.json package.json
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
cache-dependency-path: tmp/package-ci.json
- run: npm install --ignore-scripts --omit=optional
- run: .github/workflows/scripts/textlint.sh

Expand All @@ -24,15 +29,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Create and use reduced-dependencies package.json
run: |
mkdir -p tmp
jq '.devDependencies |= with_entries(
select(.key | test("gulp|markdown|through|require|yargs"))
)
| del(.dependencies, .optionalDependencies)' \
package.json > tmp/package-min.json
cp tmp/package-min.json package.json
package.json > tmp/package-ci.json
cp tmp/package-ci.json package.json
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
cache-dependency-path: tmp/package-ci.json
- run: npm install --ignore-scripts --omit=optional
- run: npm run check:markdown

0 comments on commit 9b688be

Please sign in to comment.