-
-
Notifications
You must be signed in to change notification settings - Fork 21
156 lines (151 loc) · 5.96 KB
/
npm-ls_demo-results.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# For details of what checks are run for PRs please refer below
# docs: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: npm-ls demo results
on:
workflow_dispatch:
env:
DEMO_ROOT_DIR: demo
RESULTS_DIR: CI_results
RESULTS_ARTIFACT: npm-ls-results
jobs:
demo-results:
name: '${{ matrix.subject }} ${{matrix.additional_nom-ls_args}} | npm${{ matrix.npm-version }} node${{ matrix.node-version }} ${{ matrix.os }}'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # gather all the results !
matrix:
subject:
# - deps-from-git
# - alternative-package-registry
# - bundled-dependencies
# - dev-dependencies
# - juice-shop
# - local-dependencies
- local-workspaces
# - package-integrity
# - package-with-build-id
additional_nom-ls_args: [ '' ]
npm-version:
## see https://www.npmjs.com/package/npm?activeTab=versions
## see also: https://github.com/npm/cli/releases
- '10' # Current
- '9' # Legacy
- '8' # Legacy
- '7' # Legacy
- '6' # Legacy
node-version:
## action based on https://github.com/actions/node-versions/releases
## see also: https://nodejs.org/en/about/releases/
- '22' # Current
- '20' # Active LTS
- '18'
- '16'
- '14'
os:
- ubuntu-latest
- windows-latest
- macos-latest
include:
- subject: local-workspaces
additional_nom-ls_args: '-w my-local-e'
npm-version: '10' # Current
node-version: '22' # Current
os: ubuntu-latest
- subject: local-workspaces
additional_nom-ls_args: '-w my-local -w my-local-e'
npm-version: '10' # Current
node-version: '22' # Current
os: ubuntu-latest
- subject: local-workspaces
additional_nom-ls_args: '--workspaces'
npm-version: '10' # Current
node-version: '22' # Current
os: ubuntu-latest
exclude:
- # macos-latest no longer supports node14
os: macos-latest
node-version: '14'
- # npm10 requires node ^18.17.0 || >=20.5.0
npm-version: '10'
node-version: '16'
- # npm10 requires node ^18.17.0 || >=20.5.0
npm-version: '10'
node-version: '14'
- # npm9 upgrade/install failed on node14
npm-version: '9'
node-version: '14'
- # our specific version of juice-shop might not be node22 compatible
subject: juice-shop
node-version: '22'
- # our specific version of juice-shop might not be node14 compatible
subject: juice-shop
node-version: '14'
- # our specific version of juice-shop might not be npm6 compatible
subject: juice-shop
npm-version: '6'
- # workspaces are a feature of NPM since 7.0
subject: local-workspaces
npm-version: '6'
timeout-minutes: 10 # this is a large matrix, just don't waste time!
steps:
- name: Checkout
# see https://github.com/actions/checkout
uses: actions/checkout@v4
- name: prepare output
run: |
mkdir -p '${{ env.RESULTS_DIR }}'
echo 'OUT_FILE_PREFIX=${{ env.RESULTS_DIR }}/npm-ls${{ matrix.additional_nom-ls_args }}_npm${{ matrix.npm-version }}_node${{ matrix.node-version }}_${{ matrix.os }}' >> $GITHUB_ENV
working-directory: '${{ env.DEMO_ROOT_DIR}}/${{ matrix.subject }}'
shell: bash # don't want to write tht code twice, windows and unix-like
- name: Setup Node.js ${{ matrix.node-version }}
# see https://github.com/actions/setup-node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
check-latest: true
- name: up-/down-grade npm to ${{ matrix.npm-version }}
run: npm i -g 'npm@${{ matrix.npm-version }}'
- name: report versions
run: |
node --version
npm --version
- name: setup demo
run: npm i --no-audit --no-fund --ignore-scripts
working-directory: ${{ env.DEMO_ROOT_DIR }}/${{ matrix.subject }}/project
- name: npm-ls ls --json --all --long
# important: the command in use is the same used by the internal builders of this project
run: >
npm --prefix project
ls --json --all --long ${{ matrix.additional_nom-ls_args }}
2> '${{ env.OUT_FILE_PREFIX }}.err.log'
1> '${{ env.OUT_FILE_PREFIX }}.json'
working-directory: '${{ env.DEMO_ROOT_DIR}}/${{ matrix.subject }}'
- name: Artifact RESULTS
# see https://github.com/actions/upload-artifact
uses: actions/upload-artifact@v4
with:
name: '${{ env.RESULTS_ARTIFACT }}_${{ matrix.subject }}${{ matrix.additional_nom-ls_args }}_npm${{ matrix.npm-version }}_node${{ matrix.node-version }}_${{ matrix.os }}'
path: '${{ env.DEMO_ROOT_DIR}}/*/${{ env.RESULTS_DIR }}'
if-no-files-found: error
retention-days: 3
combine-results:
name: combine results
needs: [ 'demo-results' ]
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
steps:
- name: fetch and combine RESULTS
# see https://github.com/actions/download-artifact
uses: actions/download-artifact@v4
with:
pattern: '${{ env.RESULTS_ARTIFACT }}_*'
merge-multiple: true
path: '${{ env.DEMO_ROOT_DIR}}'
- name: Artifact RESULTS
# see https://github.com/actions/upload-artifact
uses: actions/upload-artifact@v4
with:
name: '${{ env.RESULTS_ARTIFACT }}-combined'
path: '${{ env.DEMO_ROOT_DIR}}'
if-no-files-found: error
retention-days: 3