Repository navigation
feat(toolchain): 设置页原处选解释器,可用项目外的虚拟环境与 Hatch、virtualenvwrapper 环境(1.2.0 预发布) #48
This file contains hidden or 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
| name: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| package: | |
| uses: ./.github/workflows/package.yml | |
| verify-store: | |
| needs: package | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Verify release tag checks | |
| run: node --test --test-timeout=30000 scripts/ci/release/publish.test.mjs | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| pattern: python-support-archive-* | |
| merge-multiple: true | |
| path: dist | |
| - name: Verify six release archives | |
| env: | |
| LITHE_EXPECT_ALL_ARCHIVES: "1" | |
| run: node --test --test-timeout=60000 scripts/package/*.test.mjs | |
| - name: Validate against Lithe Store rules | |
| run: | | |
| git clone --depth 1 https://github.com/Lithe-IDEA/Lithe-store "$RUNNER_TEMP/store" | |
| node --input-type=module -e " | |
| import { readPackageManifests, checkManifest } from '$RUNNER_TEMP/store/scripts/validate-index.mjs'; | |
| import { readdirSync, readFileSync } from 'node:fs'; | |
| const manifest = JSON.parse(readFileSync('io.github.lithe-idea.python-support/plugin.json', 'utf8')); | |
| const entry = { id: manifest.id }; | |
| let failed = false; | |
| for (const name of readdirSync('dist').filter((n) => n.endsWith('.zip'))) { | |
| const { manifests, unsafe } = readPackageManifests('dist/' + name, entry.id); | |
| const problems = [...unsafe, ...checkManifest(manifests, entry, manifest)]; | |
| for (const problem of problems) { console.error(name + ': ' + problem); failed = true; } | |
| } | |
| process.exit(failed ? 1 : 0); | |
| " | |
| commands: | |
| needs: package | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 20 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| platform: linux-x64 | |
| - os: macos-latest | |
| platform: darwin-arm64 | |
| - os: windows-latest | |
| platform: windows-x64 | |
| - os: windows-11-arm | |
| platform: windows-arm64 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install pytest for live test-discovery and execution checks | |
| run: python -m pip install --disable-pip-version-check pytest | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: python-support-archive-${{ matrix.platform }} | |
| path: dist | |
| - name: Unpack Windows archive under a path with spaces | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| $archive = Get-ChildItem "dist\python-support-*-${{ matrix.platform }}.zip" | Select-Object -First 1 | |
| $plugins = Join-Path $env:RUNNER_TEMP "Lithe Plugins" | |
| Expand-Archive -Path $archive.FullName -DestinationPath $plugins | |
| "LITHE_TEST_PLUGIN_DIR=$plugins\io.github.lithe-idea.python-support" | Out-File $env:GITHUB_ENV -Append -Encoding utf8 | |
| - name: Run contract, model, pyrefly, debugpy, and immutability tests | |
| run: | | |
| python --version || python3 --version | |
| node scripts/test.mjs | |
| host-e2e: | |
| needs: package | |
| runs-on: macos-latest | |
| timeout-minutes: 45 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - uses: actions/setup-go@v7 | |
| with: | |
| go-version: "1.27.3" | |
| cache: false | |
| - uses: dtolnay/rust-toolchain@1.100.0 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: python-support-archive-darwin-arm64 | |
| path: dist | |
| - name: Install pytest for the host suite | |
| run: python -m pip install --disable-pip-version-check pytest | |
| - name: Run the full Python host suite on the pinned desktop | |
| env: | |
| GOFLAGS: -tags=vivahead | |
| LITHE_PYTHON_VISUAL_DIR: ${{ runner.temp }}/python-workbench-screenshots | |
| run: PYTEST_PYTHON="$(command -v python)" node scripts/e2e-host.mjs | |
| - name: Upload the Python workbench screenshots | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: python-workbench-screenshots | |
| path: ${{ runner.temp }}/python-workbench-screenshots/*.png | |
| if-no-files-found: error |