Skip to content

Commit 5b65537

Browse files
committed
feat: add names to all jobs and steps
1 parent caf393c commit 5b65537

40 files changed

+1440
-1020
lines changed

.github/workflows/audit.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,25 @@ on:
1010

1111
jobs:
1212
audit:
13+
name: Audit
1314
if: github.repository_owner == 'npm'
1415
runs-on: ubuntu-latest
1516
steps:
16-
- uses: actions/checkout@v3
17-
- name: Setup git user
17+
- name: Checkout
18+
uses: actions/checkout@v3
19+
- name: Setup Git User
1820
run: |
1921
git config --global user.email "[email protected]"
2022
git config --global user.name "npm CLI robot"
21-
- uses: actions/setup-node@v3
23+
- name: Setup Node
24+
uses: actions/setup-node@v3
2225
with:
2326
node-version: 18.x
24-
- name: Update npm to latest
27+
- name: Install npm@latest
2528
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
26-
- run: npm -v
27-
- run: npm i --ignore-scripts --no-audit --no-fund --package-lock
28-
- run: npm audit
29+
- name: npm Version
30+
run: npm -v
31+
- name: Install Dependencies
32+
run: npm i --ignore-scripts --no-audit --no-fund --package-lock
33+
- name: Run Audit
34+
run: npm audit

.github/workflows/ci-release.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# This file is automatically added by @npmcli/template-oss. Do not edit.
2+
3+
name: CI - Release
4+
5+
on:
6+
workflow_call:
7+
inputs:
8+
ref:
9+
required: true
10+
type: string
11+
12+
jobs:
13+
lint-all:
14+
name: Lint All
15+
if: github.repository_owner == 'npm'
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v3
20+
with:
21+
ref: ${{ inputs.ref }}
22+
- name: Setup Git User
23+
run: |
24+
git config --global user.email "[email protected]"
25+
git config --global user.name "npm CLI robot"
26+
- name: Setup Node
27+
uses: actions/setup-node@v3
28+
with:
29+
node-version: 18.x
30+
- name: Install npm@latest
31+
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
32+
- name: npm Version
33+
run: npm -v
34+
- name: Install Dependencies
35+
run: npm i --ignore-scripts --no-audit --no-fund
36+
- name: Lint
37+
run: npm run lint --ignore-scripts
38+
- name: Post Lint
39+
run: npm run postlint --ignore-scripts
40+
41+
test-all:
42+
name: Test All - ${{ matrix.platform.name }} - Node ${{ matrix.node-version }}
43+
if: github.repository_owner == 'npm'
44+
strategy:
45+
fail-fast: false
46+
matrix:
47+
platform:
48+
- name: Linux
49+
os: ubuntu-latest
50+
shell: bash
51+
- name: macOS
52+
os: macos-latest
53+
shell: bash
54+
- name: Windows
55+
os: windows-latest
56+
shell: cmd
57+
node-version:
58+
- 14.17.0
59+
- 14.x
60+
- 16.13.0
61+
- 16.x
62+
- 18.0.0
63+
- 18.x
64+
runs-on: ${{ matrix.platform.os }}
65+
defaults:
66+
run:
67+
shell: ${{ matrix.platform.shell }}
68+
steps:
69+
- name: Checkout
70+
uses: actions/checkout@v3
71+
with:
72+
ref: ${{ inputs.ref }}
73+
- name: Setup Git User
74+
run: |
75+
git config --global user.email "[email protected]"
76+
git config --global user.name "npm CLI robot"
77+
- name: Setup Node
78+
uses: actions/setup-node@v3
79+
with:
80+
node-version: ${{ matrix.node-version }}
81+
- name: Update Windows npm
82+
# node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows
83+
if: matrix.platform.os == 'windows-latest' && (startsWith(matrix.node-version, '12.') || startsWith(matrix.node-version, '14.'))
84+
run: |
85+
curl -sO https://registry.npmjs.org/npm/-/npm-7.5.4.tgz
86+
tar xf npm-7.5.4.tgz
87+
cd package
88+
node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
89+
cd ..
90+
rmdir /s /q package
91+
- name: Install npm@7
92+
if: startsWith(matrix.node-version, '10.')
93+
run: npm i --prefer-online --no-fund --no-audit -g npm@7
94+
- name: Install npm@latest
95+
if: ${{ !startsWith(matrix.node-version, '10.') }}
96+
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
97+
- name: npm Version
98+
run: npm -v
99+
- name: Install Dependencies
100+
run: npm i --ignore-scripts --no-audit --no-fund
101+
- name: Add Problem Matcher
102+
run: echo "::add-matcher::.github/matchers/tap.json"
103+
- name: Test
104+
run: npm test --ignore-scripts -ws -iwr --if-present

.github/workflows/ci.yml

Lines changed: 41 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,56 +15,70 @@ on:
1515

1616
jobs:
1717
lint:
18+
name: Lint
1819
if: github.repository_owner == 'npm'
1920
runs-on: ubuntu-latest
2021
steps:
21-
- uses: actions/checkout@v3
22-
- name: Setup git user
22+
- name: Checkout
23+
uses: actions/checkout@v3
24+
- name: Setup Git User
2325
run: |
2426
git config --global user.email "[email protected]"
2527
git config --global user.name "npm CLI robot"
26-
- uses: actions/setup-node@v3
28+
- name: Setup Node
29+
uses: actions/setup-node@v3
2730
with:
2831
node-version: 18.x
29-
- name: Update npm to latest
32+
- name: Install npm@latest
3033
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
31-
- run: npm -v
32-
- run: npm i --ignore-scripts --no-audit --no-fund
33-
- run: npm run lint
34+
- name: npm Version
35+
run: npm -v
36+
- name: Install Dependencies
37+
run: npm i --ignore-scripts --no-audit --no-fund
38+
- name: Lint
39+
run: npm run lint --ignore-scripts
40+
- name: Post Lint
41+
run: npm run postlint --ignore-scripts
3442

3543
test:
44+
name: Test - ${{ matrix.platform.name }} - Node ${{ matrix.node-version }}
3645
if: github.repository_owner == 'npm'
3746
strategy:
3847
fail-fast: false
3948
matrix:
49+
platform:
50+
- name: Linux
51+
os: ubuntu-latest
52+
shell: bash
53+
- name: macOS
54+
os: macos-latest
55+
shell: bash
56+
- name: Windows
57+
os: windows-latest
58+
shell: cmd
4059
node-version:
4160
- 14.17.0
4261
- 14.x
4362
- 16.13.0
4463
- 16.x
4564
- 18.0.0
4665
- 18.x
47-
platform:
48-
- os: ubuntu-latest
49-
shell: bash
50-
- os: macos-latest
51-
shell: bash
52-
- os: windows-latest
53-
shell: cmd
5466
runs-on: ${{ matrix.platform.os }}
5567
defaults:
5668
run:
5769
shell: ${{ matrix.platform.shell }}
5870
steps:
59-
- uses: actions/checkout@v3
60-
- name: Setup git user
71+
- name: Checkout
72+
uses: actions/checkout@v3
73+
- name: Setup Git User
6174
run: |
6275
git config --global user.email "[email protected]"
6376
git config --global user.name "npm CLI robot"
64-
- uses: actions/setup-node@v3
77+
- name: Setup Node
78+
uses: actions/setup-node@v3
6579
with:
6680
node-version: ${{ matrix.node-version }}
67-
- name: Update to workable npm (windows)
81+
- name: Update Windows npm
6882
# node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows
6983
if: matrix.platform.os == 'windows-latest' && (startsWith(matrix.node-version, '12.') || startsWith(matrix.node-version, '14.'))
7084
run: |
@@ -74,15 +88,17 @@ jobs:
7488
node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
7589
cd ..
7690
rmdir /s /q package
77-
- name: Update npm to 7
78-
# If we do test on npm 10 it needs npm7
91+
- name: Install npm@7
7992
if: startsWith(matrix.node-version, '10.')
8093
run: npm i --prefer-online --no-fund --no-audit -g npm@7
81-
- name: Update npm to latest
94+
- name: Install npm@latest
8295
if: ${{ !startsWith(matrix.node-version, '10.') }}
8396
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
84-
- run: npm -v
85-
- run: npm i --ignore-scripts --no-audit --no-fund
86-
- name: add tap problem matcher
97+
- name: npm Version
98+
run: npm -v
99+
- name: Install Dependencies
100+
run: npm i --ignore-scripts --no-audit --no-fund
101+
- name: Add Problem Matcher
87102
run: echo "::add-matcher::.github/matchers/tap.json"
88-
- run: npm test --ignore-scripts
103+
- name: Test
104+
run: npm test --ignore-scripts -iwr

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ jobs:
2424
contents: read
2525
security-events: write
2626
steps:
27-
- uses: actions/checkout@v3
28-
- name: Setup git user
27+
- name: Checkout
28+
uses: actions/checkout@v3
29+
- name: Setup Git User
2930
run: |
3031
git config --global user.email "[email protected]"
3132
git config --global user.name "npm CLI robot"

.github/workflows/post-dependabot.yml

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,67 @@
11
# This file is automatically added by @npmcli/template-oss. Do not edit.
22

3-
name: Post Dependabot Actions
3+
name: Post Dependabot
44

55
on: pull_request
66

77
permissions:
88
contents: write
99

1010
jobs:
11-
template-oss-apply:
11+
template-oss:
12+
name: "@npmcli/template-oss"
1213
if: github.repository_owner == 'npm' && github.actor == 'dependabot[bot]'
1314
runs-on: ubuntu-latest
1415
steps:
15-
- uses: actions/checkout@v3
16+
- name: Checkout
17+
uses: actions/checkout@v3
1618
with:
1719
ref: ${{ github.event.pull_request.head_ref }}
18-
- name: Setup git user
20+
- name: Setup Git User
1921
run: |
2022
git config --global user.email "[email protected]"
2123
git config --global user.name "npm CLI robot"
22-
- uses: actions/setup-node@v3
24+
- name: Setup Node
25+
uses: actions/setup-node@v3
2326
with:
2427
node-version: 18.x
25-
- name: Update npm to latest
28+
- name: Install npm@latest
2629
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
27-
- run: npm -v
28-
- run: npm i --ignore-scripts --no-audit --no-fund
29-
- name: Dependabot metadata
30+
- name: npm Version
31+
run: npm -v
32+
- name: Install Dependencies
33+
run: npm i --ignore-scripts --no-audit --no-fund
34+
- name: Fetch Dependabot Metadata
3035
id: metadata
3136
uses: dependabot/fetch-metadata@v1
3237
with:
3338
github-token: ${{ secrets.GITHUB_TOKEN }}
3439

35-
- name: Get command flags
40+
# Dependabot can update multiple directories so we output which directory
41+
# it is acting on so we can run the command for the correct root or workspace
42+
- name: Get Dependabot Directory
3643
if: contains(steps.metadata.outputs.dependency-names, '@npmcli/template-oss')
3744
id: flags
3845
run: |
39-
if [[ "${{steps.metadata.outputs.directory}}" == "/" ]]; then
46+
if [[ "${{ steps.metadata.outputs.directory }}" == "/" ]]; then
4047
echo "::set-output name=workspace::-iwr"
4148
else
4249
echo "::set-output name=workspace::-w ${{ steps.metadata.outputs.directory }}"
4350
fi
4451
45-
- name: Apply changes
52+
- name: Apply Changes
4653
if: steps.flags.outputs.workspace
4754
id: apply
4855
run: |
49-
npm run template-oss-apply ${{steps.flags.outputs.workspace}}
56+
npm run template-oss-apply ${{ steps.flags.outputs.workspace }}
5057
if [[ `git status --porcelain` ]]; then
5158
echo "::set-output name=changes::true"
5259
fi
5360
54-
- name: Push all changes
61+
# This step will fail if template-oss has made any workflow updates. It is impossible
62+
# for a workflow to update other workflows. In the case it does fail, we continue
63+
# and then try to apply only a portion of the changes in the next step
64+
- name: Push All Changes
5565
if: steps.apply.outputs.changes
5666
id: push
5767
continue-on-error: true
@@ -61,7 +71,7 @@ jobs:
6171
git commit -am "chore: postinstall for dependabot template-oss PR"
6272
git push
6373
64-
- name: Push all except workflows
74+
- name: Push All Changes Except Workflows
6575
if: steps.push.outcome == 'failure'
6676
env:
6777
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -72,7 +82,7 @@ jobs:
7282
git commit -am "chore: postinstall for dependabot template-oss PR"
7383
git push
7484
75-
- name: Verify changes
85+
- name: Check Changes
7686
if: steps.apply.outputs.changes
7787
run: |
78-
npm exec --offline ${{steps.flags.outputs.workspace}} -- template-oss-check
88+
npm exec --offline ${{ steps.flags.outputs.workspace }} -- template-oss-check

0 commit comments

Comments
 (0)