|
| 1 | +# This workflow runs a build with a python version that has debug symbols |
| 2 | +# Update this workflow when our min/max python minor versions update |
| 3 | +# This workflow is necessary to ensure that we can build and run with |
| 4 | +# a debug python build without too much worrying about SIGABRT being thrown |
| 5 | +# IMPORTANT: binaries are not to be uploaded from this workflow! |
| 6 | + |
| 7 | +name: Ubuntu debug python |
| 8 | +defaults: |
| 9 | + run: |
| 10 | + shell: bash -leo pipefail {0} |
| 11 | + |
| 12 | +# Run CI only on changes to main branch, or any PR to main. |
| 13 | +# Do not run CI on any other branch. Also, skip any non-source changes |
| 14 | +# from running on CI |
| 15 | +on: |
| 16 | + push: |
| 17 | + branches: main |
| 18 | + paths-ignore: |
| 19 | + - 'docs/**' |
| 20 | + - 'examples/**' |
| 21 | + - '.gitignore' |
| 22 | + - '*.rst' |
| 23 | + - '*.md' |
| 24 | + - '.github/workflows/*.yml' |
| 25 | + # re-include current file to not be excluded |
| 26 | + - '!.github/workflows/build-ubuntu-debug-python.yml' |
| 27 | + |
| 28 | + pull_request: |
| 29 | + branches: main |
| 30 | + paths-ignore: |
| 31 | + - 'docs/**' |
| 32 | + - 'examples/**' |
| 33 | + - '.gitignore' |
| 34 | + - '*.rst' |
| 35 | + - '*.md' |
| 36 | + - '.github/workflows/*.yml' |
| 37 | + # re-include current file to not be excluded |
| 38 | + - '!.github/workflows/build-ubuntu-debug-python.yml' |
| 39 | + |
| 40 | +concurrency: |
| 41 | + group: ${{ github.workflow }}-${{ github.ref }}-ubuntu-debug-python |
| 42 | + cancel-in-progress: true |
| 43 | + |
| 44 | +jobs: |
| 45 | + debug_python: |
| 46 | + runs-on: ${{ matrix.os }} |
| 47 | + strategy: |
| 48 | + fail-fast: false # if a particular matrix build fails, don't skip the rest |
| 49 | + matrix: |
| 50 | + os: [ ubuntu-24.04 ] |
| 51 | + # check our min python (minor) version and our max python (minor) version |
| 52 | + python: [ |
| 53 | + 3.9.21, |
| 54 | + 3.13.1 |
| 55 | + ] |
| 56 | + |
| 57 | + env: |
| 58 | + # Pip now forces us to either make a venv or set this flag, so we will do |
| 59 | + # this |
| 60 | + PIP_BREAK_SYSTEM_PACKAGES: 1 |
| 61 | + # We are using dependencies installed from apt |
| 62 | + PG_DEPS_FROM_SYSTEM: 1 |
| 63 | + |
| 64 | + steps: |
| 65 | + |
| 66 | + |
| 67 | + - name: Install pygame-ce deps |
| 68 | + # https://github.com/actions/runner-images/issues/7192 |
| 69 | + # https://github.com/orgs/community/discussions/47863 |
| 70 | + run: | |
| 71 | + sudo apt-get update --fix-missing |
| 72 | +
|
| 73 | + sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libfreetype6-dev libportmidi-dev -y |
| 74 | +
|
| 75 | + - name: Install pyenv |
| 76 | + run: | |
| 77 | + sudo apt install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev |
| 78 | + curl https://pyenv.run | bash |
| 79 | +
|
| 80 | + echo -e 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile |
| 81 | + echo -e 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile |
| 82 | + echo -e 'eval "$(pyenv init --path)"' >> ~/.bash_profile |
| 83 | + echo -e 'eval "$(pyenv init -)"' >> ~/.bash_profile |
| 84 | +
|
| 85 | + - name: Cache debug python build |
| 86 | + id: cache-python |
| 87 | + |
| 88 | + with: |
| 89 | + key: ${{ matrix.python }} |
| 90 | + path: ~/.pyenv/versions/${{ matrix.python }}-debug/** |
| 91 | + |
| 92 | + - name: Build debug python |
| 93 | + id: build |
| 94 | + if: steps.cache-python.outputs.cache-hit != 'true' |
| 95 | + run: pyenv install ${{ matrix.python }} --debug -v |
| 96 | + |
| 97 | + - name: Build pygame-ce |
| 98 | + id: build-pygame-ce |
| 99 | + run: | |
| 100 | + pyenv global ${{ matrix.python }}-debug |
| 101 | + python dev.py build --lax |
| 102 | +
|
| 103 | + - name: Run tests |
| 104 | + env: |
| 105 | + SDL_VIDEODRIVER: "dummy" |
| 106 | + SDL_AUDIODRIVER: "disk" |
| 107 | + run: | |
| 108 | + pyenv global ${{ matrix.python }}-debug |
| 109 | + python -m pygame.tests -v --exclude opengl,music,timing --time_out 300 |
0 commit comments