Skip to content

Commit 0da61ea

Browse files
committed
Merge branch 'main' into lazy-numpy
2 parents 2508d15 + a88e23b commit 0da61ea

File tree

150 files changed

+5636
-4542
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+5636
-4542
lines changed

.github/workflows/build-debian-multiarch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ jobs:
121121
runs-on: ubuntu-22.04
122122
steps:
123123
- name: Download all multiarch artifacts
124-
uses: actions/download-artifact@v4
124+
uses: actions/download-artifact@v5
125125
with:
126126
name: pygame-multiarch-armv7-dist
127127
path: ~/artifacts

.github/workflows/build-macos.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232

3333
- name: Test for Mac Deps cache hit
3434
id: macdep-cache
35-
uses: actions/cache@v4.2.3
35+
uses: actions/cache@v4.2.4
3636
with:
3737
path: ${{ github.workspace }}/pygame_mac_deps_${{ matrix.macarch }}
3838
# The hash of all files in buildconfig manylinux-build and macdependencies is
@@ -99,14 +99,14 @@ jobs:
9999
- uses: actions/checkout@v4.2.2
100100

101101
- name: pip cache
102-
uses: actions/cache@v4.2.3
102+
uses: actions/cache@v4.2.4
103103
with:
104104
path: ~/Library/Caches/pip # This cache path is only right on mac
105105
key: pip-cache-${{ matrix.macarch }}-${{ matrix.os }}
106106

107107
- name: Fetch Mac deps
108108
id: macdep-cache
109-
uses: actions/cache@v4.2.3
109+
uses: actions/cache@v4.2.4
110110
with:
111111
path: ${{ github.workspace }}/pygame_mac_deps_${{ matrix.macarch }}
112112
key: macdep-${{ hashFiles('buildconfig/manylinux-build/**') }}-${{ hashFiles('buildconfig/macdependencies/*.sh') }}-${{ matrix.macarch }}
@@ -115,10 +115,10 @@ jobs:
115115
- name: Install uv for speed
116116
uses: astral-sh/setup-uv@v6
117117
with:
118-
version: "0.5.26"
118+
version: "0.8.3"
119119

120120
- name: Build and test wheels
121-
uses: pypa/cibuildwheel@v2.23.2
121+
uses: pypa/cibuildwheel@v3.1.3
122122

123123
- uses: actions/upload-artifact@v4
124124
with:

.github/workflows/build-manylinux.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- uses: actions/checkout@v4.2.2
3737

3838
- name: Log in to the Container registry
39-
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772
39+
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1
4040
with:
4141
registry: ghcr.io
4242
username: ${{ github.actor }}
@@ -49,7 +49,7 @@ jobs:
4949

5050
- name: Extract metadata (tags, labels) for Docker
5151
id: meta
52-
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804
52+
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f
5353
with:
5454
images: ghcr.io/${{ github.repository }}_${{ matrix.arch }}
5555
tags: type=raw,value=${{ hashFiles('buildconfig/manylinux-build/**') }}
@@ -74,7 +74,7 @@ jobs:
7474
CIBW_MANYLINUX_AARCH64_IMAGE: ghcr.io/${{ github.repository }}_aarch64:${{ steps.meta.outputs.version }}
7575
CIBW_MANYLINUX_PYPY_AARCH64_IMAGE: ghcr.io/${{ github.repository }}_aarch64:${{ steps.meta.outputs.version }}
7676

77-
uses: pypa/cibuildwheel@v2.23.2
77+
uses: pypa/cibuildwheel@v3.1.3
7878

7979
# We upload the generated files under github actions assets
8080
- name: Upload dist

.github/workflows/build-ubuntu-coverage.yml

Lines changed: 0 additions & 97 deletions
This file was deleted.

.github/workflows/build-windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ jobs:
4040
- name: Install uv for speed
4141
uses: astral-sh/setup-uv@v6
4242
with:
43-
version: "0.5.26"
43+
version: "0.8.3"
4444

4545
- name: Build and test wheels
46-
uses: pypa/cibuildwheel@v2.23.2
46+
uses: pypa/cibuildwheel@v3.1.3
4747

4848
- uses: actions/upload-artifact@v4
4949
with:

.github/workflows/cppcheck.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/release-gh-draft.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- uses: actions/checkout@v4.2.2
3030

3131
- name: Download all artifacts
32-
uses: actions/download-artifact@v4
32+
uses: actions/download-artifact@v5
3333
with:
3434
path: pygame-wheels
3535
merge-multiple: true
@@ -41,7 +41,7 @@ jobs:
4141
run: echo "VER=${GITHUB_REF_NAME#'release/'}" >> $GITHUB_OUTPUT
4242

4343
- name: Generate release attestation
44-
uses: actions/attest-build-provenance@v2.3.0
44+
uses: actions/attest-build-provenance@v2.4.0
4545
with:
4646
subject-path: "pygame-wheels/*"
4747

.github/workflows/build-ubuntu-debug-python.yml renamed to .github/workflows/run-ubuntu-checks.yml

Lines changed: 68 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
# This workflow runs a build with a python version that has debug symbols
1+
# This workflow runs a build with a python version that has debug symbols.
2+
# Also generates coverage information from unit tests. Note that for intrinsics,
3+
# it only runs what gets compiled and would naturally run. It also is limited to
4+
# what can run in a CI environment.
25
# Update this workflow when our min/max python minor versions update
36
# This workflow is necessary to ensure that we can build and run with
47
# a debug python build without too much worrying about SIGABRT being thrown
58
# IMPORTANT: binaries are not to be uploaded from this workflow!
69

7-
name: Ubuntu debug python
10+
name: Ubuntu Checks
811
defaults:
912
run:
1013
shell: bash -leo pipefail {0}
@@ -23,7 +26,7 @@ on:
2326
- '*.md'
2427
- '.github/workflows/*.yml'
2528
# re-include current file to not be excluded
26-
- '!.github/workflows/build-ubuntu-debug-python.yml'
29+
- '!.github/workflows/run-ubuntu-checks.yml'
2730

2831
pull_request:
2932
branches: main
@@ -35,23 +38,24 @@ on:
3538
- '*.md'
3639
- '.github/workflows/*.yml'
3740
# re-include current file to not be excluded
38-
- '!.github/workflows/build-ubuntu-debug-python.yml'
41+
- '!.github/workflows/run-ubuntu-checks.yml'
3942

4043
concurrency:
41-
group: ${{ github.workflow }}-${{ github.ref }}-ubuntu-debug-python
44+
group: ${{ github.workflow }}-${{ github.ref }}-ubuntu-checks
4245
cancel-in-progress: true
4346

4447
jobs:
45-
debug_python:
48+
debug_coverage:
4649
runs-on: ${{ matrix.os }}
4750
strategy:
4851
fail-fast: false # if a particular matrix build fails, don't skip the rest
4952
matrix:
5053
os: [ ubuntu-24.04 ]
5154
# check our min python (minor) version and our max python (minor) version
5255
python: [
53-
3.9.21,
54-
3.13.1
56+
3.9.23,
57+
3.13.5,
58+
3.14.0rc1
5559
]
5660

5761
env:
@@ -69,7 +73,7 @@ jobs:
6973
# https://github.com/orgs/community/discussions/47863
7074
run: |
7175
sudo apt-get update --fix-missing
72-
76+
sudo apt-get install lcov -y
7377
sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libfreetype6-dev libportmidi-dev -y
7478
7579
- name: Install pyenv
@@ -84,7 +88,7 @@ jobs:
8488
8589
- name: Cache debug python build
8690
id: cache-python
87-
uses: actions/cache@v4.2.3
91+
uses: actions/cache@v4.2.4
8892
with:
8993
key: ${{ matrix.python }}
9094
path: ~/.pyenv/versions/${{ matrix.python }}-debug/**
@@ -98,7 +102,7 @@ jobs:
98102
id: build-pygame-ce
99103
run: |
100104
pyenv global ${{ matrix.python }}-debug
101-
python dev.py build --lax
105+
python dev.py build --lax --coverage --sanitize undefined
102106
103107
- name: Run tests
104108
env:
@@ -107,3 +111,56 @@ jobs:
107111
run: |
108112
pyenv global ${{ matrix.python }}-debug
109113
python -m pygame.tests -v --exclude opengl,music,timing --time_out 300
114+
115+
- name: Generate coverage
116+
id: gen-coverage
117+
# want to continue regardless of whether a test failed or not as long as the job wasn't cancelled
118+
if: ${{ steps.build-pygame-ce.conclusion == 'success' && !cancelled() }}
119+
run: |
120+
lcov --capture --directory . --output-file ./coverage.info
121+
genhtml ./coverage.info --output-directory ./out
122+
123+
# We upload the generated files under github actions assets
124+
- name: Upload coverage html
125+
# want to continue only if the coverage generation was successful
126+
if: ${{ steps.gen-coverage.conclusion == 'success' && !cancelled() }}
127+
uses: actions/upload-artifact@v4
128+
with:
129+
name: pygame-coverage-${{ matrix.os }}-${{ matrix.python }}
130+
path: ./out
131+
132+
# Run cppcheck static analysis on src_c changes
133+
run-cppcheck:
134+
runs-on: ubuntu-24.04
135+
needs: debug_coverage
136+
137+
steps:
138+
- uses: actions/checkout@v4.2.2
139+
with:
140+
fetch-depth: 0 # fetch full history
141+
142+
- name: Check if any src_c files changed
143+
id: check-changes
144+
continue-on-error: true
145+
run: |
146+
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
147+
CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}...HEAD)
148+
else
149+
CHANGED_FILES=$(git diff --name-only HEAD^1...HEAD)
150+
fi
151+
echo "Changed files: $CHANGED_FILES"
152+
echo "$CHANGED_FILES" | grep '^src_c/' || echo "skip=true" >> "$GITHUB_OUTPUT"
153+
154+
- name: Install cppcheck
155+
if: steps.check-changes.outputs.skip != 'true'
156+
run: |
157+
sudo apt-get update --fix-missing
158+
sudo apt install cppcheck
159+
160+
- name: Run Static Checker
161+
if: steps.check-changes.outputs.skip != 'true'
162+
run: cppcheck src_c --enable=performance,portability,warning \
163+
--suppress=*:src_c/freetype/ft_cache.c --suppress=*:src_c/scrap* \
164+
--suppress=*:src_c/scale_mmx*.c --suppress=*:src_c/SDL_gfx/* \
165+
--suppress=missingReturn --suppress=syntaxError -DWITH_THREAD -j $(nproc) \
166+
-DPG_MAJOR_VERSION -DPG_MINOR_VERSION -DPG_PATCH_VERSION -DPG_VERSION_TAG

0 commit comments

Comments
 (0)