From 247c66a2a0c27d978828bb4cf7fadfde4c251fb8 Mon Sep 17 00:00:00 2001 From: John Sirois Date: Sun, 9 Feb 2025 05:38:15 -0800 Subject: [PATCH] Initial Windows CI setup w/o caching. More work towards #2658. --- .github/workflows/ci.yml | 45 +++++++++++++++++++ .../integration/test_shebang_length_limit.py | 8 +++- 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 938bc2c01..3bf2a19fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -198,6 +198,7 @@ jobs: with: ssh-private-key: ${{ env.SSH_PRIVATE_KEY }} - name: Run Tests + continue-on-error: true uses: pex-tool/actions/run-tox@c53dadd8b410bbd66480de91067e9e45d2b3af38 with: path: repo/tox.ini @@ -216,12 +217,56 @@ jobs: with: path: ${{ env._PEX_TEST_DEV_ROOT }}/devpi key: ${{ steps.restore-devpi-server.outputs.cache-primary-key }} + windows-tests: + name: "Windows: tox -e ${{ matrix.tox-env }} ${{ matrix.pex-test-pos-args }}" + needs: org-check + runs-on: windows-2022 + strategy: + matrix: + include: + - python-version: [ 3, 13 ] + tox-env: format-check,lint-check,typecheck,package,docs + - python-version: [ 3, 13 ] + tox-env: py313-pip25_0 + pex-test-pos-args: --color -vvs + - python-version: [ 3, 13 ] + tox-env: py313-pip25_0-integration + pex-test-pos-args: --color -vvs --shard 1/2 + - python-version: [ 3, 13 ] + tox-env: py313-pip25_0-integration + pex-test-pos-args: --color -vvs --shard 2/2 + steps: + - name: Checkout Pex + uses: actions/checkout@v4 + with: + # We need branches and tags for some ITs. + fetch-depth: 0 + path: repo + - name: Setup Python ${{ join(matrix.python-version, '.') }} + uses: actions/setup-python@v5 + with: + python-version: "${{ join(matrix.python-version, '.') }}" + # Some ITs need this for VCS URLs of the form git+ssh://git@github.com/... + - name: Setup SSH Agent + uses: webfactory/ssh-agent@v0.9.0 + env: + SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} + if: env.SSH_PRIVATE_KEY != '' + with: + ssh-private-key: ${{ env.SSH_PRIVATE_KEY }} + - name: Run Tests + uses: pex-tool/actions/run-tox@c53dadd8b410bbd66480de91067e9e45d2b3af38 + with: + path: repo/tox.ini + tox-env: >- + ${{ matrix.tox-env }} -- ${{ matrix.pex-test-pos-args }} final-status: name: Gather Final Status needs: - checks - linux-tests - mac-tests + - windows-tests runs-on: ubuntu-24.04 steps: - name: Check Non-Success diff --git a/tests/integration/test_shebang_length_limit.py b/tests/integration/test_shebang_length_limit.py index 610082634..90548d19e 100644 --- a/tests/integration/test_shebang_length_limit.py +++ b/tests/integration/test_shebang_length_limit.py @@ -18,6 +18,7 @@ from pex.common import safe_open, touch from pex.executables import chmod_plus_x from pex.fs import safe_symlink +from pex.os import WINDOWS from pex.typing import TYPE_CHECKING from testing import IS_PYPY, make_project, run_pex_command from testing.cli import run_pex3 @@ -51,7 +52,12 @@ def find_max_length( # Pytest fails to cleanup tmp dirs used probing file_path_length_limit and this squashes a very # large ream of warnings. -pytestmark = pytest.mark.filterwarnings("ignore:\\(rm_rf\\) error removing.*:pytest.PytestWarning") +if WINDOWS: + pytestmark = pytest.mark.skip("The current process of probing limits can break Windows.") +else: + pytestmark = pytest.mark.filterwarnings( + "ignore:\\(rm_rf\\) error removing.*:pytest.PytestWarning" + ) @pytest.fixture(scope="session")