|
| 1 | +# PR validation and CI builds for the debugpy public repo. |
| 2 | +# Separate internal pipelines are used for generating wheels, signing, and releasing to pypi.org. |
| 3 | +name: PR validation |
| 4 | + |
| 5 | +on: |
| 6 | + push: |
| 7 | + branches: |
| 8 | + - main |
| 9 | + - release/* |
| 10 | + pull_request: |
| 11 | + workflow_dispatch: |
| 12 | + |
| 13 | +permissions: |
| 14 | + contents: read |
| 15 | + |
| 16 | +concurrency: |
| 17 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 18 | + cancel-in-progress: ${{ github.event_name == 'pull_request' }} |
| 19 | + |
| 20 | +env: |
| 21 | + PYDEVD_ATTACH_TO_PROCESS: src/debugpy/_vendored/pydevd/pydevd_attach_to_process |
| 22 | + |
| 23 | +jobs: |
| 24 | + lint: |
| 25 | + name: Lint |
| 26 | + runs-on: ubuntu-latest |
| 27 | + timeout-minutes: 5 |
| 28 | + steps: |
| 29 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 30 | + |
| 31 | + - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 |
| 32 | + with: |
| 33 | + python-version: "3.10" |
| 34 | + |
| 35 | + - name: Install ruff |
| 36 | + run: python -m pip install -U ruff |
| 37 | + |
| 38 | + - name: Run ruff |
| 39 | + run: python -m ruff check --output-format=github . |
| 40 | + |
| 41 | + build-pydevd: |
| 42 | + name: Build pydevd binaries - ${{ matrix.os }} |
| 43 | + runs-on: ${{ matrix.image }} |
| 44 | + strategy: |
| 45 | + fail-fast: false |
| 46 | + matrix: |
| 47 | + include: |
| 48 | + - os: Windows |
| 49 | + image: windows-latest |
| 50 | + script: compile_windows.bat |
| 51 | + working-directory: src/debugpy/_vendored/pydevd/pydevd_attach_to_process/windows |
| 52 | + contents: | |
| 53 | + src/debugpy/_vendored/pydevd/pydevd_attach_to_process/*.exe |
| 54 | + src/debugpy/_vendored/pydevd/pydevd_attach_to_process/*.dll |
| 55 | + src/debugpy/_vendored/pydevd/pydevd_attach_to_process/*.pdb |
| 56 | + - os: macOS |
| 57 | + image: macos-latest |
| 58 | + script: src/debugpy/_vendored/pydevd/pydevd_attach_to_process/linux_and_mac/compile_mac.sh |
| 59 | + working-directory: . |
| 60 | + contents: src/debugpy/_vendored/pydevd/pydevd_attach_to_process/*.dylib |
| 61 | + - os: Linux |
| 62 | + image: ubuntu-latest |
| 63 | + script: src/debugpy/_vendored/pydevd/pydevd_attach_to_process/linux_and_mac/compile_linux.sh |
| 64 | + working-directory: . |
| 65 | + contents: src/debugpy/_vendored/pydevd/pydevd_attach_to_process/*.so |
| 66 | + steps: |
| 67 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 68 | + |
| 69 | + - name: Build pydevd binaries (Windows) |
| 70 | + if: runner.os == 'Windows' |
| 71 | + shell: cmd |
| 72 | + working-directory: ${{ matrix.working-directory }} |
| 73 | + run: call ${{ matrix.script }} |
| 74 | + |
| 75 | + - name: Build pydevd binaries (Unix) |
| 76 | + if: runner.os != 'Windows' |
| 77 | + working-directory: ${{ matrix.working-directory }} |
| 78 | + run: bash ${{ matrix.script }} |
| 79 | + |
| 80 | + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 |
| 81 | + with: |
| 82 | + name: pydevd-binaries-${{ matrix.os }} |
| 83 | + path: ${{ matrix.contents }} |
| 84 | + if-no-files-found: error |
| 85 | + |
| 86 | + test: |
| 87 | + name: Tests - ${{ matrix.os }} - Python ${{ matrix.python }} |
| 88 | + needs: build-pydevd |
| 89 | + runs-on: ${{ matrix.image }} |
| 90 | + timeout-minutes: ${{ matrix.os == 'Windows' && 40 || 30 }} |
| 91 | + strategy: |
| 92 | + fail-fast: false |
| 93 | + matrix: |
| 94 | + os: [Linux, macOS, Windows] |
| 95 | + python: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"] |
| 96 | + include: |
| 97 | + - os: Linux |
| 98 | + image: ubuntu-latest |
| 99 | + - os: macOS |
| 100 | + image: macos-latest |
| 101 | + - os: Windows |
| 102 | + image: windows-latest |
| 103 | + steps: |
| 104 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 105 | + |
| 106 | + - name: Setup gdb |
| 107 | + if: runner.os == 'Linux' |
| 108 | + run: | |
| 109 | + sudo apt-get update |
| 110 | + sudo apt-get --yes install gdb |
| 111 | + sudo sysctl kernel.yama.ptrace_scope=0 |
| 112 | +
|
| 113 | + - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 |
| 114 | + with: |
| 115 | + python-version: ${{ matrix.python }} |
| 116 | + allow-prereleases: true |
| 117 | + |
| 118 | + - name: Download pydevd binaries |
| 119 | + uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 |
| 120 | + with: |
| 121 | + pattern: pydevd-binaries-* |
| 122 | + merge-multiple: true |
| 123 | + path: ${{ env.PYDEVD_ATTACH_TO_PROCESS }} |
| 124 | + |
| 125 | + - name: Setup Python packages |
| 126 | + run: python -m pip install tox |
| 127 | + |
| 128 | + - name: Run tests using tox |
| 129 | + shell: bash |
| 130 | + env: |
| 131 | + DEBUGPY_PROCESS_SPAWN_TIMEOUT: 60 |
| 132 | + DEBUGPY_LAUNCH_TIMEOUT: 60 |
| 133 | + PYTHON_VERSION: ${{ matrix.python }} |
| 134 | + run: | |
| 135 | + if [ "$RUNNER_OS" = "macOS" ]; then |
| 136 | + ulimit -Sn 8192 |
| 137 | + fi |
| 138 | + tox_env="py${PYTHON_VERSION//./}" |
| 139 | + echo "Derived tox environment: $tox_env" |
| 140 | + python -m tox -e "$tox_env" -- \ |
| 141 | + --junitxml="$RUNNER_TEMP/test-results/tests.xml" \ |
| 142 | + --debugpy-log-dir="$RUNNER_TEMP/logs" \ |
| 143 | + tests |
| 144 | +
|
| 145 | + - name: Publish test logs |
| 146 | + if: failure() |
| 147 | + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 |
| 148 | + with: |
| 149 | + name: test-logs-${{ matrix.os }}-py${{ matrix.python }} |
| 150 | + path: ${{ runner.temp }}/logs |
| 151 | + if-no-files-found: ignore |
| 152 | + |
| 153 | + - name: Publish test results |
| 154 | + if: always() |
| 155 | + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 |
| 156 | + with: |
| 157 | + name: test-results-${{ matrix.os }}-py${{ matrix.python }} |
| 158 | + path: ${{ runner.temp }}/test-results |
| 159 | + if-no-files-found: ignore |
0 commit comments