Skip to content

feat: switch from nodejs-bin to nodejs-wheel #534

feat: switch from nodejs-bin to nodejs-wheel

feat: switch from nodejs-bin to nodejs-wheel #534

Workflow file for this run

name: 'Validation'
env:
# TODO: ideally this would be controlled by the nodejs-bin package, but idk how the venv tests work so i left them as-is
NODE_VERSION: '18' # Shipped with VS Code.
PYTHON_VERSION: 3.11
on:
pull_request:
branches: [main]
jobs:
static_checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: ./pw pdm use ${{ env.PYTHON_VERSION }}
# need to use pw script at least once even when activating the context so that the wrapper installs pyprojectx
- run: ./pw pdm lock --check
- name: activate pyprojectx context
run: realpath ./.pyprojectx/main >> $GITHUB_PATH
- run: pdm install
- name: typescript typecheck
run: pdm run npx lerna exec --stream --no-bail -- tsc --noEmit
- run: pdm run npm run check
- name: python typecheck
run: pdm run typecheck
- name: ruff check
run: pdm run ruff check --output-format github
- name: ruff format
run: pdm run ruff format --check --diff
- name: pylint
run: pdm run pylint
test:
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
name: Test ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
# Don't cache on Windows; the cache ends up being very large and
# the Windows implementation of the cache task uses a much slower archiver.
- name: Get npm cache directory
if: runner.os != 'Windows'
id: npm-cache
shell: bash
run: |
echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
if: runner.os != 'Windows'
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm run install:all
- name: npm test (pyright-internal)
run: npm test
working-directory: packages/pyright-internal
# Install python so we can create a VENV for tests
- name: Use Python ${{env.PYTHON_VERSION}}
uses: actions/setup-python@v4
id: install_python
with:
python-version: ${{env.PYTHON_VERSION}}
- name: Create Venv
run: |
${{ steps.install_python.outputs.python-path }} -m venv .venv
- name: Activate and install pytest (linux)
if: runner.os != 'Windows'
run: |
source .venv/bin/activate
python -m pip install pytest
python -c "import sys;print('python_venv_path=' + sys.executable)" >> $GITHUB_ENV
- name: Activate and install pytest (windows)
if: runner.os == 'Windows'
run: |
.venv\scripts\activate
python -m pip install pytest
python -c "import sys;print('python_venv_path=' + sys.executable)" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Echo python_venv_path
run: |
echo python_venv_path=${{env.python_venv_path}}
- name: Run import tests with venv
env:
CI_IMPORT_TEST_VENVPATH: '../../'
CI_IMPORT_TEST_VENV: '.venv'
run: npm run test:imports
working-directory: packages/pyright-internal
- name: Run import tests with pythonpath
env:
CI_IMPORT_TEST_PYTHONPATH: ${{env.python_venv_path}}
run: npm run test:imports
working-directory: packages/pyright-internal
build:
runs-on: ubuntu-latest
name: Build
needs: static_checks
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Get npm cache directory
id: npm-cache
shell: bash
run: |
echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm run install:all
- run: npm publish --dry-run
working-directory: packages/pyright
- run: npm run package
working-directory: packages/vscode-pyright
required:
runs-on: ubuntu-latest
name: Required
needs:
- static_checks
- test
- build
steps:
- run: echo All required jobs succeeded.