Skip to content

Commit

Permalink
Reuse workflow for CI builds (#11503)
Browse files Browse the repository at this point in the history
  • Loading branch information
michelleangela authored Oct 12, 2023
1 parent 4af6ca9 commit 74bddb8
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 119 deletions.
46 changes: 5 additions & 41 deletions .github/workflows/ci_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,44 +7,8 @@ on:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3

- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16

- name: Install Dependencies
run: yarn install
working-directory: Extension

- name: Compile Sources
run: yarn run compile
working-directory: Extension

- name: Run Linter
run: yarn run lint
working-directory: Extension

- name: Run unit tests
run: yarn test
working-directory: Extension

# # NOTE : We can't run the test that require the native binary files
# # yet -- there will be an update soon that allows the tester to
# # acquire them on-the-fly
# - name: Run simple vscode unit tests
# uses: GabrielBB/[email protected]
# with:
# run: yarn test --scenario=SingleRootProject
# working-directory: Extension

# - name: Run languageServer integration tests
# uses: GabrielBB/[email protected]
# with:
# run: yarn run integrationTests
# working-directory: Extension
job:
uses: ./.github/workflows/job-compile-and-test.yml
with:
runner-env: ubuntu-22.04
platform: linux
47 changes: 6 additions & 41 deletions .github/workflows/ci_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,44 +7,9 @@ on:
branches: [ main ]

jobs:
build:
runs-on: macos-12

steps:
- uses: actions/checkout@v3

- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16

- name: Install Dependencies
run: yarn install --network-timeout 100000
working-directory: Extension

- name: Compile Sources
run: yarn run compile
working-directory: Extension

- name: Run Linter
run: yarn run lint
working-directory: Extension

- name: Run unit tests
run: yarn test
working-directory: Extension

# # NOTE : We can't run the test that require the native binary files
# # yet -- there will be an update soon that allows the tester to
# # acquire them on-the-fly
# - name: Run simple vscode unit tests
# uses: GabrielBB/[email protected]
# with:
# run: yarn test --scenario=SingleRootProject
# working-directory: Extension

# - name: Run languageServer integration tests
# uses: GabrielBB/[email protected]
# with:
# run: yarn run integrationTests
# working-directory: Extension
job:
uses: ./.github/workflows/job-compile-and-test.yml
with:
runner-env: macos-12
platform: mac
yarn-args: --network-timeout 100000
42 changes: 5 additions & 37 deletions .github/workflows/ci_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,8 @@ on:
branches: [ main ]

jobs:
build:
runs-on: windows-2022

steps:
- uses: actions/checkout@v3

- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16

- name: Install Dependencies
run: yarn install
working-directory: Extension

- name: Compile Sources
run: yarn run compile
working-directory: Extension

- name: Run Linter
run: yarn run lint
working-directory: Extension

- name: Run unit tests
run: yarn test
working-directory: Extension

# # NOTE : We can't run the test that require the native binary files
# # yet -- there will be an update soon that allows the tester to
# # acquire them on-the-fly
# - name: Run simple vscode unit tests
# run: yarn test --scenario=SingleRootProject
# working-directory: Extension

# - name: Run languageServer integration tests
# run: yarn run integrationTests
# working-directory: Extension
job:
uses: ./.github/workflows/job-compile-and-test.yml
with:
runner-env: windows-2022
platform: windows
73 changes: 73 additions & 0 deletions .github/workflows/job-compile-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Reuable workflow for compiling and testing extension.
name: Compile and test extension

on:
workflow_call:
inputs:
runner-env:
required: true
type: string
platform:
# Expects 'mac', 'linux', or 'windows'
required: true
type: string
yarn-args:
type: string

jobs:
build:
runs-on: ${{ inputs.runner-env }}

steps:
- uses: actions/checkout@v3

- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16

- name: Install Dependencies
run: yarn install ${{ inputs.yarn-args }}
working-directory: Extension

- name: Compile Sources
run: yarn run compile
working-directory: Extension

- name: Run Linter
run: yarn run lint
working-directory: Extension

- name: Run unit tests
run: yarn test
working-directory: Extension

# NOTE : We can't run the test that require the native binary files
# yet -- there will be an update soon that allows the tester to
# acquire them on-the-fly
# - name: Run languageServer integration tests
# if: ${{ inputs.platform == 'windows' }}
# run: yarn test --scenario=SingleRootProject
# working-directory: Extension

# - name: Run E2E IntelliSense features tests
# if: ${{ inputs.platform == 'windows' }}
# run: yarn test --scenario=MultirootDeadlockTest
# working-directory: Extension

# NOTE: For mac/linux run the tests with xvfb-action for UI support.
# Another way to start xvfb https://github.com/microsoft/vscode-test/blob/master/sample/azure-pipelines.yml

# - name: Run languageServer integration tests (xvfb)
# if: ${{ inputs.platform == 'mac' || inputs.platform == 'linux' }}
# uses: coactions/setup-xvfb@v1
# with:
# run: yarn test --scenario=SingleRootProject
# working-directory: Extension

# - name: Run E2E IntelliSense features tests (xvfb)
# if: ${{ inputs.platform == 'mac' || inputs.platform == 'linux' }}
# uses: coactions/setup-xvfb@v1
# with:
# run: yarn test --scenario=MultirootDeadlockTest
# working-directory: Extension

0 comments on commit 74bddb8

Please sign in to comment.