Skip to content

test: Fix test_queue timing issue #2027

test: Fix test_queue timing issue

test: Fix test_queue timing issue #2027

# this workflow tests sdist builds and also doubles as a way to test that
# pygame compiles on all ubuntu LTS versions
# the main difference between this and the manylinux builds is that this runs
# directly under ubuntu and uses apt installed dependencies, while the
# manylinux workflow runs with centos docker and self-compiled dependencies
# IMPORTANT: binaries are not to be uploaded from this workflow!
name: Ubuntu sdist
# Run CI only when a release is created, on changes to main branch, or any PR
# to main. Do not run CI on any other branch. Also, skip any non-source changes
# from running on CI
on:
release:
types: [published]
push:
branches: main
paths-ignore:
- 'docs/**'
- 'examples/**'
- '.gitignore'
- '*.rst'
- '*.md'
- '.github/workflows/*.yml'
# re-include current file to not be excluded
- '!.github/workflows/build-ubuntu-sdist.yml'
pull_request:
branches:
- main
- 'v**'
paths-ignore:
- 'docs/**'
- 'examples/**'
- '.gitignore'
- '*.rst'
- '*.md'
- '.github/workflows/*.yml'
# re-include current file to not be excluded
- '!.github/workflows/build-ubuntu-sdist.yml'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # if a particular matrix build fails, don't skip the rest
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
python-version: [ "3.10" ]
steps:
- uses: actions/checkout@v4.1.2
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install deps
id: install_deps
continue-on-error: true
# install numpy from pip and not apt because the one from pip is newer,
# and has typestubs
run: |
sudo apt-get update --fix-missing
sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libfreetype6-dev libportmidi-dev libjpeg-dev python3-setuptools python3-dev
python3 -m pip install sphinx numpy>=1.21.0 Cython==3.0.0
- name: Install deps retry
if: steps.install_deps.outcome == 'failure'
run: |
sudo apt-get update --fix-missing
sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libfreetype6-dev libportmidi-dev libjpeg-dev python3-setuptools python3-dev
python3 -m pip install sphinx numpy>=1.21.0 Cython==3.0.0
- name: Make sdist and install it
env:
PIP_CONFIG_FILE: "buildconfig/pip_config.ini"
run: |
python3 setup.py docs
python3 setup.py sdist
python3 -m pip install dist/pygame-*.tar.gz -vv
- name: Run tests
env:
SDL_VIDEODRIVER: "dummy"
SDL_AUDIODRIVER: "disk"
run: python3 -m pygame.tests -v --exclude opengl,music,timing --time_out 300
- name: Test typestubs
if: matrix.os == 'ubuntu-22.04' && matrix.python-version == '3.10' # run stubtest only once
run: |
cd buildconfig/stubs
python3 -m pip install mypy==1.4.1
python3 -m mypy.stubtest pygame --allowlist mypy_allow_list.txt
- name: Typecheck examples
if: matrix.os == 'ubuntu-22.04' && matrix.python-version == '3.10' # run typecheckers only once
run: |
python3 -m pip install pyright pytype
python3 -m mypy examples/testsprite.py examples/sound.py examples/dropevent.py examples/stars.py examples/aliens.py examples/eventlist.py examples/midi.py examples/video.py examples/scroll.py examples/music_drop_fade.py
python3 -m pyright examples/testsprite.py examples/sound.py examples/dropevent.py examples/stars.py examples/aliens.py examples/eventlist.py examples/midi.py examples/video.py examples/scroll.py examples/music_drop_fade.py
python3 -m pytype examples/testsprite.py examples/sound.py examples/dropevent.py examples/stars.py examples/aliens.py examples/eventlist.py examples/midi.py examples/video.py examples/scroll.py examples/music_drop_fade.py
# We upload the generated files under github actions assets
- name: Upload sdist
if: matrix.os == 'ubuntu-22.04' && matrix.python-version == '3.10' # upload sdist only once
uses: actions/upload-artifact@v3
with:
name: pygame-sdist
path: dist/*.tar.gz
# - name: Upload binaries to Github Releases
# if: github.event_name == 'release' && matrix.os == 'ubuntu-22.04' # upload sdist only once
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: dist/*.tar.gz
# tag: ${{ github.ref }}
#
- name: Publish to PyPI
if: github.event.action == 'published' && matrix.os == 'ubuntu-22.04' # upload sdist only once
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python3 -m pip install twine
python3 -m twine upload dist/*.tar.gz