-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use actions for smoke tests to build vsix
- Loading branch information
1 parent
3e317cb
commit 9c2ddba
Showing
3 changed files
with
250 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
name: 'Build VSIX' | ||
description: "Build the extension's VSIX" | ||
|
||
inputs: | ||
node_version: | ||
description: 'Version of Node to install' | ||
required: true | ||
vsix_name: | ||
description: 'Name to give the final VSIX' | ||
required: true | ||
artifact_name: | ||
description: 'Name to give the artifact containing the VSIX' | ||
required: true | ||
cargo_target: | ||
description: 'Cargo build target for the native build' | ||
required: true | ||
vsix_target: | ||
description: 'vsix build target for the native build' | ||
required: true | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Update working directory | ||
run: cd extensions/positron-python | ||
shell: bash | ||
|
||
- name: Install Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ inputs.node_version }} | ||
cache: 'npm' | ||
|
||
- name: Rust Tool Chain setup | ||
uses: dtolnay/rust-toolchain@stable | ||
|
||
# Jedi LS depends on dataclasses which is not in the stdlib in Python 3.7. | ||
- name: Use Python 3.8 for JediLSP | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.8 | ||
cache: 'pip' | ||
cache-dependency-path: | | ||
requirements.txt | ||
python_files/jedilsp_requirements/requirements.txt | ||
- name: Upgrade Pip | ||
run: python -m pip install -U pip | ||
shell: bash | ||
|
||
# For faster/better builds of sdists. | ||
- name: Install build pre-requisite | ||
run: python -m pip install wheel nox | ||
shell: bash | ||
|
||
- name: Install Python Extension dependencies (jedi, etc.) | ||
run: nox --session install_python_libs | ||
shell: bash | ||
|
||
- name: Add Rustup target | ||
run: rustup target add ${{ inputs.cargo_target }} | ||
shell: bash | ||
|
||
- name: Build Native Binaries | ||
run: nox --session native_build | ||
shell: bash | ||
env: | ||
CARGO_TARGET: ${{ inputs.cargo_target }} | ||
|
||
- name: Run npm ci | ||
run: npm ci --prefer-offline | ||
shell: bash | ||
|
||
- name: Update optional extension dependencies | ||
run: npm run addExtensionPackDependencies | ||
shell: bash | ||
|
||
- name: Build Webpack | ||
run: | | ||
npx gulp clean | ||
npx gulp prePublishBundle | ||
shell: bash | ||
|
||
- name: Build VSIX | ||
run: npx vsce package --target ${{ inputs.vsix_target }} --out ms-python-insiders.vsix --pre-release | ||
shell: bash | ||
|
||
- name: Rename VSIX | ||
# Move to a temp name in case the specified name happens to match the default name. | ||
run: mv ms-python-insiders.vsix ms-python-temp.vsix && mv ms-python-temp.vsix ${{ inputs.vsix_name }} | ||
shell: bash | ||
|
||
- name: Upload VSIX | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ inputs.artifact_name }} | ||
path: ${{ inputs.vsix_name }} | ||
if-no-files-found: error | ||
retention-days: 7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: 'Smoke tests' | ||
description: 'Run smoke tests' | ||
|
||
inputs: | ||
node_version: | ||
description: 'Version of Node to install' | ||
required: true | ||
artifact_name: | ||
description: 'Name of the artifact containing the VSIX' | ||
required: true | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Update working directory | ||
run: cd extensions/positron-python | ||
shell: bash | ||
|
||
- name: Install Node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ inputs.node_version }} | ||
cache: 'npm' | ||
|
||
- name: Install Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
cache: 'pip' | ||
cache-dependency-path: | | ||
build/test-requirements.txt | ||
requirements.txt | ||
- name: Install dependencies (npm ci) | ||
run: npm ci --prefer-offline | ||
shell: bash | ||
|
||
- name: Install Python requirements | ||
uses: brettcannon/pip-secure-install@v1 | ||
with: | ||
options: '-t ./python_files/lib/python --implementation py' | ||
|
||
- name: pip install system test requirements | ||
run: | | ||
python -m pip install --upgrade -r build/test-requirements.txt | ||
shell: bash | ||
|
||
# Bits from the VSIX are reused by smokeTest.ts to speed things up. | ||
- name: Download VSIX | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ${{ inputs.artifact_name }} | ||
|
||
- name: Prepare for smoke tests | ||
run: npx tsc -p ./ | ||
shell: bash | ||
|
||
- name: Set CI_PYTHON_PATH and CI_DISABLE_AUTO_SELECTION | ||
run: | | ||
echo "CI_PYTHON_PATH=python" >> $GITHUB_ENV | ||
echo "CI_DISABLE_AUTO_SELECTION=1" >> $GITHUB_ENV | ||
shell: bash | ||
|
||
- name: Run smoke tests | ||
env: | ||
DISPLAY: 10 | ||
INSTALL_JUPYTER_EXTENSION: true | ||
uses: GabrielBB/xvfb-action@v1.7 | ||
with: | ||
run: node --no-force-async-hooks-checks ./out/test/smokeTest.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters