106 lines
3.5 KiB
YAML
106 lines
3.5 KiB
YAML
# 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
|
|
checkout-ref:
|
|
required: false
|
|
type: string
|
|
yarn-args:
|
|
type: string
|
|
|
|
env:
|
|
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ${{ inputs.runner-env }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
ref: ${{ inputs.checkout-ref }}
|
|
|
|
- name: Use Node.js 24
|
|
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
|
with:
|
|
node-version: 24
|
|
|
|
- name: Validate Yarn lockfile
|
|
run: yarn test-yarn-lock && yarn verify-yarn-lock
|
|
working-directory: Extension
|
|
|
|
- name: Install Dependencies
|
|
run: yarn install ${{ inputs.yarn-args }}
|
|
working-directory: Extension
|
|
|
|
- name: Install gdb (linux)
|
|
if: ${{ inputs.platform == 'linux' }}
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y gdb
|
|
|
|
- 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
|
|
|
|
- name: Acquire Native Binaries
|
|
run: yarn install-and-copy-binaries-for-test
|
|
working-directory: Extension
|
|
|
|
- name: Run languageServer integration tests (Windows)
|
|
if: ${{ inputs.platform == 'windows' }}
|
|
run: yarn test --scenario=SingleRootProject
|
|
working-directory: Extension
|
|
|
|
- name: Run E2E IntelliSense features tests (Windows)
|
|
if: ${{ inputs.platform == 'windows' }}
|
|
run: yarn test --scenario=MultirootDeadlockTest
|
|
working-directory: Extension
|
|
|
|
- name: Run RunWithoutDebugging tests (Windows)
|
|
if: ${{ inputs.platform == 'windows' }}
|
|
run: yarn test --scenario=RunWithoutDebugging
|
|
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 (linux/macOS)
|
|
if: ${{ inputs.platform == 'mac' || inputs.platform == 'linux' }}
|
|
uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 # v1.0.1
|
|
with:
|
|
run: yarn test --scenario=SingleRootProject
|
|
working-directory: Extension
|
|
|
|
- name: Run E2E IntelliSense features tests (linux/macOS)
|
|
if: ${{ inputs.platform == 'mac' || inputs.platform == 'linux' }}
|
|
uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 # v1.0.1
|
|
with:
|
|
run: yarn test --scenario=MultirootDeadlockTest
|
|
working-directory: Extension
|
|
|
|
- name: Run RunWithoutDebugging tests (linux/macOS)
|
|
if: ${{ inputs.platform == 'mac' || inputs.platform == 'linux' }}
|
|
uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 # v1.0.1
|
|
with:
|
|
run: yarn test --scenario=RunWithoutDebugging --scenario-arg=skipExternalConsole
|
|
working-directory: Extension
|
|
|