Skip to content

Commit 74bddb8

Browse files
Reuse workflow for CI builds (#11503)
1 parent 4af6ca9 commit 74bddb8

File tree

4 files changed

+89
-119
lines changed

4 files changed

+89
-119
lines changed

.github/workflows/ci_linux.yml

Lines changed: 5 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -7,44 +7,8 @@ on:
77
branches: [ main ]
88

99
jobs:
10-
build:
11-
runs-on: ubuntu-22.04
12-
13-
steps:
14-
- uses: actions/checkout@v3
15-
16-
- name: Use Node.js 16
17-
uses: actions/setup-node@v3
18-
with:
19-
node-version: 16
20-
21-
- name: Install Dependencies
22-
run: yarn install
23-
working-directory: Extension
24-
25-
- name: Compile Sources
26-
run: yarn run compile
27-
working-directory: Extension
28-
29-
- name: Run Linter
30-
run: yarn run lint
31-
working-directory: Extension
32-
33-
- name: Run unit tests
34-
run: yarn test
35-
working-directory: Extension
36-
37-
# # NOTE : We can't run the test that require the native binary files
38-
# # yet -- there will be an update soon that allows the tester to
39-
# # acquire them on-the-fly
40-
# - name: Run simple vscode unit tests
41-
# uses: GabrielBB/[email protected]
42-
# with:
43-
# run: yarn test --scenario=SingleRootProject
44-
# working-directory: Extension
45-
46-
# - name: Run languageServer integration tests
47-
# uses: GabrielBB/[email protected]
48-
# with:
49-
# run: yarn run integrationTests
50-
# working-directory: Extension
10+
job:
11+
uses: ./.github/workflows/job-compile-and-test.yml
12+
with:
13+
runner-env: ubuntu-22.04
14+
platform: linux

.github/workflows/ci_mac.yml

Lines changed: 6 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -7,44 +7,9 @@ on:
77
branches: [ main ]
88

99
jobs:
10-
build:
11-
runs-on: macos-12
12-
13-
steps:
14-
- uses: actions/checkout@v3
15-
16-
- name: Use Node.js 16
17-
uses: actions/setup-node@v3
18-
with:
19-
node-version: 16
20-
21-
- name: Install Dependencies
22-
run: yarn install --network-timeout 100000
23-
working-directory: Extension
24-
25-
- name: Compile Sources
26-
run: yarn run compile
27-
working-directory: Extension
28-
29-
- name: Run Linter
30-
run: yarn run lint
31-
working-directory: Extension
32-
33-
- name: Run unit tests
34-
run: yarn test
35-
working-directory: Extension
36-
37-
# # NOTE : We can't run the test that require the native binary files
38-
# # yet -- there will be an update soon that allows the tester to
39-
# # acquire them on-the-fly
40-
# - name: Run simple vscode unit tests
41-
# uses: GabrielBB/[email protected]
42-
# with:
43-
# run: yarn test --scenario=SingleRootProject
44-
# working-directory: Extension
45-
46-
# - name: Run languageServer integration tests
47-
# uses: GabrielBB/[email protected]
48-
# with:
49-
# run: yarn run integrationTests
50-
# working-directory: Extension
10+
job:
11+
uses: ./.github/workflows/job-compile-and-test.yml
12+
with:
13+
runner-env: macos-12
14+
platform: mac
15+
yarn-args: --network-timeout 100000

.github/workflows/ci_windows.yml

Lines changed: 5 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,8 @@ on:
77
branches: [ main ]
88

99
jobs:
10-
build:
11-
runs-on: windows-2022
12-
13-
steps:
14-
- uses: actions/checkout@v3
15-
16-
- name: Use Node.js 16
17-
uses: actions/setup-node@v3
18-
with:
19-
node-version: 16
20-
21-
- name: Install Dependencies
22-
run: yarn install
23-
working-directory: Extension
24-
25-
- name: Compile Sources
26-
run: yarn run compile
27-
working-directory: Extension
28-
29-
- name: Run Linter
30-
run: yarn run lint
31-
working-directory: Extension
32-
33-
- name: Run unit tests
34-
run: yarn test
35-
working-directory: Extension
36-
37-
# # NOTE : We can't run the test that require the native binary files
38-
# # yet -- there will be an update soon that allows the tester to
39-
# # acquire them on-the-fly
40-
# - name: Run simple vscode unit tests
41-
# run: yarn test --scenario=SingleRootProject
42-
# working-directory: Extension
43-
44-
# - name: Run languageServer integration tests
45-
# run: yarn run integrationTests
46-
# working-directory: Extension
10+
job:
11+
uses: ./.github/workflows/job-compile-and-test.yml
12+
with:
13+
runner-env: windows-2022
14+
platform: windows
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Reuable workflow for compiling and testing extension.
2+
name: Compile and test extension
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
runner-env:
8+
required: true
9+
type: string
10+
platform:
11+
# Expects 'mac', 'linux', or 'windows'
12+
required: true
13+
type: string
14+
yarn-args:
15+
type: string
16+
17+
jobs:
18+
build:
19+
runs-on: ${{ inputs.runner-env }}
20+
21+
steps:
22+
- uses: actions/checkout@v3
23+
24+
- name: Use Node.js 16
25+
uses: actions/setup-node@v3
26+
with:
27+
node-version: 16
28+
29+
- name: Install Dependencies
30+
run: yarn install ${{ inputs.yarn-args }}
31+
working-directory: Extension
32+
33+
- name: Compile Sources
34+
run: yarn run compile
35+
working-directory: Extension
36+
37+
- name: Run Linter
38+
run: yarn run lint
39+
working-directory: Extension
40+
41+
- name: Run unit tests
42+
run: yarn test
43+
working-directory: Extension
44+
45+
# NOTE : We can't run the test that require the native binary files
46+
# yet -- there will be an update soon that allows the tester to
47+
# acquire them on-the-fly
48+
# - name: Run languageServer integration tests
49+
# if: ${{ inputs.platform == 'windows' }}
50+
# run: yarn test --scenario=SingleRootProject
51+
# working-directory: Extension
52+
53+
# - name: Run E2E IntelliSense features tests
54+
# if: ${{ inputs.platform == 'windows' }}
55+
# run: yarn test --scenario=MultirootDeadlockTest
56+
# working-directory: Extension
57+
58+
# NOTE: For mac/linux run the tests with xvfb-action for UI support.
59+
# Another way to start xvfb https://github.com/microsoft/vscode-test/blob/master/sample/azure-pipelines.yml
60+
61+
# - name: Run languageServer integration tests (xvfb)
62+
# if: ${{ inputs.platform == 'mac' || inputs.platform == 'linux' }}
63+
# uses: coactions/setup-xvfb@v1
64+
# with:
65+
# run: yarn test --scenario=SingleRootProject
66+
# working-directory: Extension
67+
68+
# - name: Run E2E IntelliSense features tests (xvfb)
69+
# if: ${{ inputs.platform == 'mac' || inputs.platform == 'linux' }}
70+
# uses: coactions/setup-xvfb@v1
71+
# with:
72+
# run: yarn test --scenario=MultirootDeadlockTest
73+
# working-directory: Extension

0 commit comments

Comments
 (0)