Skip to content

Commit d215c7e

Browse files
committed
Split workflow run into more jobs
The unit tests and linting is now run separately, which will hopefully speed up the time it takes for the integration tests to complete.
1 parent a88039b commit d215c7e

1 file changed

Lines changed: 63 additions & 20 deletions

File tree

.github/workflows/main.yml

Lines changed: 63 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ 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
@@ -67,13 +69,9 @@ jobs:
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,21 +81,15 @@ 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: |
9090
npm install
9191
shell: bash
9292

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
99-
shell: bash
100-
10193
- name: Lint
10294
working-directory: extensions/ql-vscode
10395
run: |
@@ -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 install
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 install
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,6 +198,8 @@ 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

0 commit comments

Comments
 (0)