@@ -23,11 +23,13 @@ jobs:
2323 - uses : actions/setup-node@v3
2424 with :
2525 node-version : ' 16.14.2'
26+ cache : ' npm'
27+ cache-dependency-path : extensions/ql-vscode/package-lock.json
2628
2729 - name : Install dependencies
2830 working-directory : extensions/ql-vscode
2931 run : |
30- npm install
32+ npm ci
3133 shell : bash
3234
3335 - name : Build
6769 LATEST=`gh api repos/dsp-testing/codeql-cli-nightlies/releases --jq '.[].tag_name' --method GET --raw-field 'per_page=1'`
6870 echo "nightly-url=https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/$LATEST" >> "$GITHUB_OUTPUT"
6971
70- test :
71- name : Test
72- runs-on : ${{ matrix.os }}
73- needs : [find-nightly]
74- strategy :
75- matrix :
76- os : [ubuntu-latest, windows-latest]
72+ lint :
73+ name : Lint
74+ runs-on : ubuntu-latest
7775 steps :
7876 - name : Checkout
7977 uses : actions/checkout@v3
@@ -83,19 +81,13 @@ jobs:
8381 - uses : actions/setup-node@v3
8482 with :
8583 node-version : ' 16.14.2'
84+ cache : ' npm'
85+ cache-dependency-path : extensions/ql-vscode/package-lock.json
8686
8787 - name : Install dependencies
8888 working-directory : extensions/ql-vscode
8989 run : |
90- npm install
91- shell : bash
92-
93- - name : Build
94- working-directory : extensions/ql-vscode
95- env :
96- APP_INSIGHTS_KEY : ' ${{ secrets.APP_INSIGHTS_KEY }}'
97- run : |
98- npm run build
90+ npm ci
9991 shell : bash
10092
10193 - name : Lint
@@ -108,18 +100,67 @@ jobs:
108100 run : |
109101 npm run lint:scenarios
110102
111- - name : Run unit tests (Linux)
103+ unit-test :
104+ name : Unit Test
105+ runs-on : ${{ matrix.os }}
106+ strategy :
107+ matrix :
108+ os : [ubuntu-latest, windows-latest]
109+ steps :
110+ - name : Checkout
111+ uses : actions/checkout@v3
112+ with :
113+ fetch-depth : 1
114+
115+ - uses : actions/setup-node@v3
116+ with :
117+ node-version : ' 16.14.2'
118+ cache : ' npm'
119+ cache-dependency-path : extensions/ql-vscode/package-lock.json
120+
121+ - name : Install dependencies
112122 working-directory : extensions/ql-vscode
113- if : matrix.os == 'ubuntu-latest'
114123 run : |
115- npm run test
124+ npm ci
125+ shell : bash
116126
117- - name : Run unit tests (Windows)
118- if : matrix.os == 'windows-latest'
127+ - name : Run unit tests
119128 working-directory : extensions/ql-vscode
120129 run : |
121130 npm run test
122131
132+ test :
133+ name : Test
134+ runs-on : ${{ matrix.os }}
135+ strategy :
136+ matrix :
137+ os : [ubuntu-latest, windows-latest]
138+ steps :
139+ - name : Checkout
140+ uses : actions/checkout@v3
141+ with :
142+ fetch-depth : 1
143+
144+ - uses : actions/setup-node@v3
145+ with :
146+ node-version : ' 16.14.2'
147+ cache : ' npm'
148+ cache-dependency-path : extensions/ql-vscode/package-lock.json
149+
150+ - name : Install dependencies
151+ working-directory : extensions/ql-vscode
152+ run : |
153+ npm ci
154+ shell : bash
155+
156+ - name : Build
157+ working-directory : extensions/ql-vscode
158+ env :
159+ APP_INSIGHTS_KEY : ' ${{ secrets.APP_INSIGHTS_KEY }}'
160+ run : |
161+ npm run build
162+ shell : bash
163+
123164 - name : Run integration tests (Linux)
124165 if : matrix.os == 'ubuntu-latest'
125166 working-directory : extensions/ql-vscode
@@ -157,11 +198,13 @@ jobs:
157198 - uses : actions/setup-node@v3
158199 with :
159200 node-version : ' 16.14.2'
201+ cache : ' npm'
202+ cache-dependency-path : extensions/ql-vscode/package-lock.json
160203
161204 - name : Install dependencies
162205 working-directory : extensions/ql-vscode
163206 run : |
164- npm install
207+ npm ci
165208 shell : bash
166209
167210 - name : Build
0 commit comments