Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
724a0f0
Add the 'security-events' permission to the CodeQL workflow (#16071)
brettcannon Apr 29, 2021
199275c
Block on displaying selected interpreter in the status bar on startup…
Apr 30, 2021
62b46b9
Indent on ``match`` and ``case`` Python 3.10 (#16104)
cdce8p May 3, 2021
aa4a25c
Add without watcher option to opt in or out (#16097)
karthiknadig May 3, 2021
eef545b
Unify build workflows (#16096)
brettcannon May 3, 2021
812be6c
Add Refresh TensorBoard command (#16068)
joyceerhl May 4, 2021
ed6f517
Fix a reference issue in the Build workflow
brettcannon May 4, 2021
c668f60
Try (again) to install debugpy wheels in CI
brettcannon May 4, 2021
6b9a71a
Drop dead env references in build workflow
brettcannon May 4, 2021
54fb576
Ignore environment related cache where appropriate (#16114)
May 4, 2021
8c86f10
Remove unused resources (#16125)
kimadeline May 4, 2021
305b021
Make not uploading a VSIX an error
brettcannon May 4, 2021
23e7774
Support for Jupyter to pass additional install args (#16133)
DonJayamanne May 4, 2021
69c6c7e
Add PyTorch profiler jump to source telemetry (#16129)
joyceerhl May 4, 2021
908684b
Correct the vsix artifact name to be uploaded (#16140)
May 4, 2021
fb6b722
Setup canvas as an optional dependency (#16130)
DonJayamanne May 4, 2021
25161d5
Put MOCHA_REPORTER_JUNIT back in
brettcannon May 5, 2021
efede18
Update the trusted workspaces setting (#16143)
brettcannon May 5, 2021
8be9f83
Correct the vsix artifact name to be downloaded (#16144)
May 5, 2021
3e79ef2
Merge default-language-server into main (#16142)
kimadeline May 5, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/actions/build-vsix/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,8 @@ runs:
- run: npm run addExtensionDependencies
shell: bash

- run: npm run addExtensionPackDependencies
shell: bash

- run: npm run package
shell: bash
114 changes: 65 additions & 49 deletions .github/workflows/insiders.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,51 @@
name: Insiders Build
name: Build

on:
push:
branches:
- main
- 'main'
- 'release'
- 'release/*'
- 'release-*'

env:
NODE_VERSION: 12.15.0
PYTHON_VERSION: 3.9
MOCHA_REPORTER_JUNIT: true # Use the mocha-multi-reporters and send output to both console (spec) and JUnit (mocha-junit-reporter). Also enables a reporter which exits the process running the tests if it haven't already.
ARTIFACT_NAME_VSIX: ms-python-insiders-vsix
VSIX_NAME: ms-python-insiders.vsix
TEST_RESULTS_DIRECTORY: .
# Force a path with spaces and to test extension works in these scenarios
# Unicode characters are causing 2.7 failures so skip that for now.
special-working-directory: './path with spaces'
special-working-directory-relative: 'path with spaces'
# Use the mocha-multi-reporters and send output to both console (spec) and JUnit (mocha-junit-reporter).
# Also enables a reporter which exits the process running the tests if it haven't already.
MOCHA_REPORTER_JUNIT: true

jobs:
setup:
name: Set up
if: github.repository == 'microsoft/vscode-python'
runs-on: ubuntu-latest
defaults:
run:
shell: python
outputs:
vsix_name: ${{ steps.vsix_names.outputs.vsix_name }}
vsix_artifact_name: ${{ steps.vsix_names.outputs.vsix_artifact_name }}
steps:
- name: VSIX names
id: vsix_names
run: |
import os
if os.environ["GITHUB_REF"].endswith("/main"):
vsix_type = "insiders"
else:
vsix_type = "release"
print(f"::set-output name=vsix_name::ms-python-{vsix_type}.vsix")
print(f"::set-output name=vsix_artifact_name::ms-python-{vsix_type}-vsix")

build-vsix:
name: Build VSIX
runs-on: ubuntu-latest
if: github.repository == 'microsoft/vscode-python'
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -31,10 +55,10 @@ jobs:
with:
node-version: ${{env.NODE_VERSION}}

- name: Use Python ${{env.PYTHON_VERSION}}
- name: Use Python 3.x
uses: actions/setup-python@v2
with:
python-version: ${{env.PYTHON_VERSION}}
python-version: 3.x

- name: Upgrade pip
run: python -m pip install -U pip
Expand All @@ -44,19 +68,20 @@ jobs:
id: build-vsix

- name: Rename VSIX
if: steps.build-vsix.outputs.path != env.VSIX_NAME
run: mv ${{ steps.build-vsix.outputs.path }} ${{ env.VSIX_NAME }}
if: steps.build-vsix.outputs.path != needs.setup.outputs.vsix_name
run: mv ${{ steps.build-vsix.outputs.path }} ${{ needs.setup.outputs.vsix_name }}

- uses: actions/upload-artifact@v2
with:
name: ${{env.ARTIFACT_NAME_VSIX}}
path: ${{env.VSIX_NAME}}
retention-days: 7
name: ${{ needs.setup.outputs.vsix_artifact_name }}
path: ${{ needs.setup.outputs.vsix_name }}
if-no-files-found: error
retention-days: 14

lint:
name: Lint
runs-on: ubuntu-latest
if: github.repository == 'microsoft/vscode-python'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -81,10 +106,10 @@ jobs:
- name: Run formatting on TypeScript code
run: npm run format-check

- name: Use Python ${{env.PYTHON_VERSION}}
- name: Use Python 3.x
uses: actions/setup-python@v2
with:
python-version: ${{env.PYTHON_VERSION}}
python-version: 3.x

- name: Run Black on Python code
run: |
Expand All @@ -95,20 +120,19 @@ jobs:
### Non-smoke tests
tests:
name: Tests
# The value of runs-on is the OS of the current job (specified in the strategy matrix below) instead of being hardcoded.
if: github.repository == 'microsoft/vscode-python'
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: ${{env.special-working-directory}}
if: github.repository == 'microsoft/vscode-python'
strategy:
fail-fast: false
matrix:
# We're not running CI on macOS for now because it's one less matrix entry to lower the number of runners used,
# macOS runners are expensive, and we assume that Ubuntu is enough to cover the UNIX case.
# We're not running CI on macOS for now because it's one less matrix
# entry to lower the number of runners used, macOS runners are expensive,
# and we assume that Ubuntu is enough to cover the UNIX case.
os: [ubuntu-latest, windows-latest]
# Run the tests on the oldest and most recent versions of Python.
python: [2.7, 3.9]
python: ['2.7', '3.x']
test-suite: [ts-unit, python-unit, venv, single-workspace, multi-workspace, debugger, functional]
steps:
- name: Checkout
Expand All @@ -127,7 +151,7 @@ jobs:
- name: Compile
run: npx gulp prePublishNonBundle

- name: Use Python ${{matrix.python}}
- name: Install Python ${{matrix.python}}
uses: actions/setup-python@v2
with:
python-version: ${{matrix.python}}
Expand All @@ -139,22 +163,22 @@ jobs:

- name: Install Python requirements
run: |
python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade -r requirements.txt --no-user
python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade -r requirements.txt
# We need to have debugpy so that tests relying on it keep passing, but we don't need install_debugpy's logic in the test phase.
python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy

- name: Install test requirements
run: python -m pip install --upgrade -r build/test-requirements.txt

- name: Install debugpy wheels (python 3.8)
- name: Install debugpy wheels
run: |
python -m pip install wheel
python -m pip --disable-pip-version-check install -r build/debugger-install-requirements.txt
python ./pythonFiles/install_debugpy.py
shell: bash
if: matrix.test-suite == 'debugger' && matrix.python == 3.8
if: matrix.test-suite == 'debugger' && matrix.python != 2.7

- name: Install debugpy (python 2.7)
- name: Install debugpy wheel (Python 2.7)
run: |
python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy
shell: bash
Expand Down Expand Up @@ -247,12 +271,10 @@ jobs:
# Run TypeScript unit tests only for Python 3.X.
- name: Run TypeScript unit tests
run: npm run test:unittests
if: matrix.test-suite == 'ts-unit' && startsWith(matrix.python, 3.)
if: matrix.test-suite == 'ts-unit' && startsWith(matrix.python, '3.')

# Run the Python tests in our codebase.
- name: Run Python unit tests
run: |
python pythonFiles/tests/run_all.py
run: python pythonFiles/tests/run_all.py
if: matrix.test-suite == 'python-unit'

# The virtual environment based tests use the `testSingleWorkspace` set of tests
Expand Down Expand Up @@ -305,20 +327,17 @@ jobs:

smoke-tests:
name: Smoke tests
# The value of runs-on is the OS of the current job (specified in the strategy matrix below) instead of being hardcoded.
runs-on: ${{ matrix.os }}
if: github.repository == 'microsoft/vscode-python'
needs: [build-vsix]
runs-on: ${{ matrix.os }}
needs: [setup, build-vsix]
strategy:
fail-fast: false
matrix:
# We're not running CI on macOS for now because it's one less matrix entry to lower the number of runners used,
# macOS runners are expensive, and we assume that Ubuntu is enough to cover the UNIX case.
os: [ubuntu-latest, windows-latest]
# 3.8 is still required here so that jupyter can install.
python: [3.8]
python: ['3.x']
steps:
# Need the source to have the tests available.
- name: Checkout
uses: actions/checkout@v2

Expand Down Expand Up @@ -351,9 +370,8 @@ jobs:
- name: Download VSIX
uses: actions/download-artifact@v2
with:
name: ${{env.ARTIFACT_NAME_VSIX}}
name: ${{ needs.setup.outputs.vsix_artifact_name }}

# Compile the test files.
- name: Prepare for smoke tests
run: npx tsc -p ./
shell: bash
Expand All @@ -374,18 +392,16 @@ jobs:

insider-tests:
name: Insider tests
# The value of runs-on is the OS of the current job (specified in the strategy matrix below) instead of being hardcoded.
runs-on: ${{ matrix.os }}
if: github.repository == 'microsoft/vscode-python'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# We're not running CI on macOS for now because it's one less matrix entry to lower the number of runners used,
# macOS runners are expensive, and we assume that Ubuntu is enough to cover the UNIX case.
os: [ubuntu-latest]
python: [3.8]
python: [3.8] # For Jupyter.
steps:
# Need the source to have the tests available.
- name: Checkout
uses: actions/checkout@v2

Expand Down Expand Up @@ -439,22 +455,22 @@ jobs:

upload:
name: Upload VSIX to Azure Blob Storage
if: github.repository == 'microsoft/vscode-python'
if: github.repository == 'microsoft/vscode-python' && github.ref == 'refs/heads/main'
needs: [setup, tests, smoke-tests, build-vsix]
runs-on: ubuntu-latest
needs: [tests, smoke-tests, build-vsix]
env:
BLOB_CONTAINER_NAME: extension-builds
BLOB_NAME: ms-python-insiders.vsix
steps:
- name: Download VSIX
uses: actions/download-artifact@v2
with:
name: ${{ env.ARTIFACT_NAME_VSIX }}
name: ${{ needs.setup.outputs.vsix_artifact_name }}
- name: Azure Login
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Upload to Blob Storage
run: az storage blob upload --file ${{ env.VSIX_NAME }} --account-name pvsc --container-name ${{ env.BLOB_CONTAINER_NAME }} --name ${{ env.BLOB_NAME }} --auth-mode login
run: az storage blob upload --file ${{ needs.setup.outputs.vsix_name }} --account-name pvsc --container-name ${{ env.BLOB_CONTAINER_NAME }} --name ${{ env.BLOB_NAME }} --auth-mode login
- name: Get URL to uploaded VSIX
run: az storage blob url --account-name pvsc --container-name ${{ env.BLOB_CONTAINER_NAME }} --name ${{ env.BLOB_NAME }} --auth-mode login
3 changes: 3 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ on:
schedule:
- cron: '0 3 * * 0'

permissions:
security-events: write

jobs:
analyze:
name: Analyze
Expand Down
Loading