初始化上传
Some checks failed
Run mypy_primer on push / Run mypy_primer on push (push) Has been cancelled
Validation / Typecheck (push) Has been cancelled
Validation / Style (push) Has been cancelled
Validation / Test macos-latest (push) Has been cancelled
Validation / Test ubuntu-latest (push) Has been cancelled
Validation / Test windows-latest (push) Has been cancelled
Validation / Build (push) Has been cancelled
Validation / Required (push) Has been cancelled
Some checks failed
Run mypy_primer on push / Run mypy_primer on push (push) Has been cancelled
Validation / Typecheck (push) Has been cancelled
Validation / Style (push) Has been cancelled
Validation / Test macos-latest (push) Has been cancelled
Validation / Test ubuntu-latest (push) Has been cancelled
Validation / Test windows-latest (push) Has been cancelled
Validation / Build (push) Has been cancelled
Validation / Required (push) Has been cancelled
This commit is contained in:
166
.github/workflows/validation.yml
vendored
Normal file
166
.github/workflows/validation.yml
vendored
Normal file
@@ -0,0 +1,166 @@
|
||||
name: 'Validation'
|
||||
|
||||
env:
|
||||
NODE_VERSION: '22.x' # Shipped with VS Code.
|
||||
PYTHON_VERSION: 3.11
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
typecheck:
|
||||
if: github.repository == 'microsoft/pyright'
|
||||
runs-on: ubuntu-latest
|
||||
name: Typecheck
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
cache: 'npm'
|
||||
cache-dependency-path: '**/package-lock.json'
|
||||
|
||||
- uses: ./.github/actions/npm-cache-dir
|
||||
|
||||
- run: npm run install:all
|
||||
|
||||
- run: npx lerna exec --stream --no-bail -- "tsc --noEmit"
|
||||
|
||||
style:
|
||||
if: github.repository == 'microsoft/pyright'
|
||||
runs-on: ubuntu-latest
|
||||
name: Style
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
cache: 'npm'
|
||||
cache-dependency-path: '**/package-lock.json'
|
||||
|
||||
- uses: ./.github/actions/npm-cache-dir
|
||||
|
||||
- run: npm run install:all
|
||||
|
||||
- name: Check diff after npm install
|
||||
run: git diff --exit-code --name-only
|
||||
|
||||
- run: npm run check
|
||||
|
||||
test:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||
|
||||
name: Test ${{ matrix.os }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
needs: typecheck
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
cache: 'npm'
|
||||
cache-dependency-path: '**/package-lock.json'
|
||||
|
||||
- uses: ./.github/actions/npm-cache-dir
|
||||
|
||||
- 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@v5
|
||||
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: typecheck
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: read
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
cache: 'npm'
|
||||
cache-dependency-path: '**/package-lock.json'
|
||||
|
||||
- uses: ./.github/actions/choose-npm-install
|
||||
|
||||
- run: npm publish --dry-run
|
||||
working-directory: packages/pyright
|
||||
|
||||
- run: npm publish --dry-run
|
||||
working-directory: packages/pyright-typeserver
|
||||
|
||||
- run: npm run package
|
||||
working-directory: packages/vscode-pyright
|
||||
|
||||
required:
|
||||
runs-on: ubuntu-latest
|
||||
name: Required
|
||||
needs:
|
||||
- typecheck
|
||||
- style
|
||||
- test
|
||||
- build
|
||||
|
||||
steps:
|
||||
- run: echo All required jobs succeeded.
|
||||
Reference in New Issue
Block a user