Skip to content

Commit f9cc620

Browse files
author
Nachoo Mangas
committed
ci: using npm-i in matrix, update steps: Configure npm, Install npm modules, Remove npm modules
1 parent 98647e6 commit f9cc620

1 file changed

Lines changed: 24 additions & 7 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,60 +49,72 @@ jobs:
4949
- name: Node.js 0.8
5050
node-version: "0.8"
5151
npm-i: mocha@2.5.3 supertest@1.1.0
52-
npm-rm: nyc
52+
npm-rm: mocha nyc supertest
5353

5454
- name: Node.js 0.10
5555
node-version: "0.10"
5656
npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.1
57-
npm-rm: nyc
57+
npm-rm: mocha nyc supertest
5858

5959
- name: Node.js 0.12
6060
node-version: "0.12"
6161
npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.1
62+
npm-rm: mocha nyc supertest
6263

6364
- name: io.js 1.x
6465
node-version: "1.8"
6566
npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.1
67+
npm-rm: mocha nyc supertest
6668

6769
- name: io.js 2.x
6870
node-version: "2.5"
6971
npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.1
72+
npm-rm: mocha nyc supertest
7073

7174
- name: io.js 3.x
7275
node-version: "3.3"
7376
npm-i: mocha@3.5.3 nyc@10.3.2 supertest@2.0.1
77+
npm-rm: mocha nyc supertest
7478

7579
- name: Node.js 4.x
7680
node-version: "4.9"
7781
npm-i: mocha@5.2.0 nyc@11.9.0 supertest@3.4.2
82+
npm-rm: mocha nyc supertest
7883

7984
- name: Node.js 5.x
8085
node-version: "5.12"
8186
npm-i: mocha@5.2.0 nyc@11.9.0 supertest@3.4.2
87+
npm-rm: mocha nyc supertest
8288

8389
- name: Node.js 6.x
8490
node-version: "6.17"
8591
npm-i: mocha@6.2.2 nyc@14.1.1
92+
npm-rm: mocha nyc supertest
8693

8794
- name: Node.js 7.x
8895
node-version: "7.10"
8996
npm-i: mocha@6.2.2 nyc@14.1.1
97+
npm-rm: mocha nyc supertest
9098

9199
- name: Node.js 8.x
92100
node-version: "8.17"
93101
npm-i: mocha@7.1.2 nyc@14.1.1
102+
npm-rm: mocha nyc supertest
94103

95104
- name: Node.js 9.x
96105
node-version: "9.11"
97106
npm-i: mocha@7.1.2 nyc@14.1.1
107+
npm-rm: mocha nyc supertest
98108

99109
- name: Node.js 10.x
100110
node-version: "10"
101111
npm-i: mocha@8.4.0
112+
npm-rm: mocha
102113

103114
- name: Node.js 11.x
104115
node-version: "11"
105116
npm-i: mocha@8.4.0
117+
npm-rm: mocha
106118

107119
- name: Node.js 12.x
108120
node-version: "12"
@@ -166,16 +178,21 @@ jobs:
166178
dirname "$(nvm which ${{ matrix.node-version }})" >> "$GITHUB_PATH"
167179
168180
- name: Configure npm
169-
run: npm config set shrinkwrap false
170-
171-
- name: Remove npm module(s) ${{ matrix.npm-rm }}
172-
run: npm rm --silent --save-dev ${{ matrix.npm-rm }}
173-
if: matrix.npm-rm != ''
181+
run: |
182+
if [[ "$(npm config get package-lock)" == "true" ]]; then
183+
npm config set package-lock false
184+
else
185+
npm config set shrinkwrap false
186+
fi
174187
175188
- name: Install npm module(s) ${{ matrix.npm-i }}
176189
run: npm install --save-dev ${{ matrix.npm-i }}
177190
if: matrix.npm-i != ''
178191

192+
- name: Remove npm module(s) ${{ matrix.npm-i }}
193+
run: npm rm --silent --save-dev ${{ matrix.npm-i }}
194+
if: matrix.npm-i != ''
195+
179196
- name: Setup Node.js version-specific dependencies
180197
shell: bash
181198
run: |

0 commit comments

Comments
 (0)