Skip to content

Commit 4d185db

Browse files
committed
Clean up workflow.
1 parent ca39236 commit 4d185db

File tree

1 file changed

+7
-25
lines changed

1 file changed

+7
-25
lines changed

.github/workflows/node.js.yml

+7-25
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ jobs:
3333
steps:
3434
- uses: actions/checkout@v4
3535

36-
- id: setup-node
37-
name: Use Node.js ${{ matrix.node-version }}
36+
- name: Use Node.js ${{ matrix.node-version }}
3837
uses: actions/setup-node@v4
3938
with:
4039
node-version: ${{ matrix.node-version }}
@@ -48,13 +47,6 @@ jobs:
4847
uses: apexskier/github-semver-parse@v1
4948
with:
5049
version: ${{ steps.node-v.outputs.version }}
51-
52-
- run: which jq
53-
54-
- env:
55-
N_MAJOR: ${{steps.node-version.outputs.major}}
56-
N_MINOR: ${{steps.node-version.outputs.minor}}
57-
run: echo "node - $N_MAJOR $N_MINOR"
5850

5951
- id: npm-v
6052
name: Output npm version
@@ -65,33 +57,23 @@ jobs:
6557
uses: apexskier/github-semver-parse@v1
6658
with:
6759
version: ${{ steps.npm-v.outputs.version }}
68-
69-
- env:
70-
N_MAJOR: ${{steps.npm-version.outputs.major}}
71-
N_MINOR: ${{steps.npm-version.outputs.minor}}
72-
run: echo "npm - $N_MAJOR $N_MINOR"
7360

7461
- id: lockfile-version
75-
name: Get package lockfileVersion
62+
name: Check package lockfileVersion
7663
run: echo "version=$(cat package-lock.json | jq '.lockfileVersion')" >> $GITHUB_OUTPUT
7764
if: hashFiles('package-lock.json') != ''
78-
79-
- env:
80-
N_MAJOR: ${{steps.lockfile-version.outputs.version}}
81-
run: echo "lockfile - $N_MAJOR"
8265

8366
- id: clean-install-v3
84-
name: Clean install with lockfileVersion >= 3
67+
name: Clean install
8568
run: npm ci
8669
if: steps.npm-version.outputs.major >= 7 && steps.lockfile-version.outputs.version >= 3
8770

8871
- id: clean-install-v3-compat
89-
name: Install with lockfileVersion >= 3
72+
name: 'Install with lockfileVersion: 3 for compatibility with npm v6'
9073
run: npm install
9174
if: steps.npm-version.outputs.major < 7 && steps.npm-version.outputs.major >= 5 && steps.lockfile-version.outputs.version >= 3
9275

93-
- id: clean-install
94-
name: Clean install
76+
- name: Clean install
9577
run: npm ci
9678
# The [`ci`][1] command was [introduced][2] with npm@5, and is intended to
9779
# be used in continuous integration environments. If npm@5 or later is
@@ -104,8 +86,8 @@ jobs:
10486
if: steps.npm-version.outputs.major >= 5 && steps.lockfile-version.outputs.version != null
10587
&& steps.clean-install-v3.outcome == 'skipped' && steps.clean-install-v3-compat.outcome == 'skipped'
10688

107-
- run: npm install
108-
name: Install
89+
- name: Install
90+
run: npm install
10991
if: steps.npm-version.outputs.major < 5 || steps.lockfile-version.outputs.version == null
11092

11193
- run: npm test

0 commit comments

Comments
 (0)