@@ -16,18 +16,20 @@ jobs:
1616 os : [ubuntu-latest, windows-latest]
1717 steps :
1818 - name : Checkout
19- uses : actions/checkout@v2
19+ uses : actions/checkout@v3
2020 with :
2121 fetch-depth : 1
2222
23- - uses : actions/setup-node@v1
23+ - 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
@@ -65,37 +67,27 @@ jobs:
6567 # This workflow step gets an unstable testing version of the CodeQL CLI. It should not be used outside of these tests.
6668 run : |
6769 LATEST=`gh api repos/dsp-testing/codeql-cli-nightlies/releases --jq '.[].tag_name' --method GET --raw-field 'per_page=1'`
68- echo "::set-output name= nightly-url:: https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/$LATEST"
70+ 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
79- uses : actions/checkout@v2
77+ uses : actions/checkout@v3
8078 with :
8179 fetch-depth : 1
8280
83- - uses : actions/setup-node@v1
81+ - uses : actions/setup-node@v3
8482 with :
85- node-version : ' 16.14.0'
83+ 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
@@ -144,24 +185,26 @@ jobs:
144185 strategy :
145186 matrix :
146187 os : [ubuntu-latest, windows-latest]
147- version : ['v2.7.6', 'v2.8.5', 'v2.9.4', 'v2.10.5', 'v2.11.2 ', 'nightly']
188+ version : ['v2.7.6', 'v2.8.5', 'v2.9.4', 'v2.10.5', 'v2.11.4 ', 'nightly']
148189 env :
149190 CLI_VERSION : ${{ matrix.version }}
150191 NIGHTLY_URL : ${{ needs.find-nightly.outputs.url }}
151192 TEST_CODEQL_PATH : ' ${{ github.workspace }}/codeql'
152193
153194 steps :
154195 - name : Checkout
155- uses : actions/checkout@v2
196+ uses : actions/checkout@v3
156197
157- - uses : actions/setup-node@v1
198+ - uses : actions/setup-node@v3
158199 with :
159- node-version : ' 16.14.0'
200+ 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
@@ -180,10 +223,10 @@ jobs:
180223 else
181224 REF="codeql-cli/${{ matrix.version }}"
182225 fi
183- echo "::set-output name= ref:: $REF"
226+ echo "ref= $REF" >> "$GITHUB_OUTPUT "
184227
185228 - name : Checkout QL
186- uses : actions/checkout@v2
229+ uses : actions/checkout@v3
187230 with :
188231 repository : github/codeql
189232 ref : ${{ steps.choose-ref.outputs.ref }}
0 commit comments