-
-
Notifications
You must be signed in to change notification settings - Fork 201
Combine all "checks" CI into a single workflow #3483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
# This workflow runs a build with a python version that has debug symbols | ||
# This workflow runs a build with a python version that has debug symbols. | ||
# Also generates coverage information from unit tests. Note that for intrinsics, | ||
# it only runs what gets compiled and would naturally run. It also is limited to | ||
# what can run in a CI environment. | ||
# Update this workflow when our min/max python minor versions update | ||
# This workflow is necessary to ensure that we can build and run with | ||
# a debug python build without too much worrying about SIGABRT being thrown | ||
# IMPORTANT: binaries are not to be uploaded from this workflow! | ||
|
||
name: Ubuntu debug python | ||
name: Ubuntu Checks | ||
defaults: | ||
run: | ||
shell: bash -leo pipefail {0} | ||
|
@@ -23,7 +26,7 @@ on: | |
- '*.md' | ||
- '.github/workflows/*.yml' | ||
# re-include current file to not be excluded | ||
- '!.github/workflows/build-ubuntu-debug-python.yml' | ||
- '!.github/workflows/run-ubuntu-checks.yml' | ||
|
||
pull_request: | ||
branches: main | ||
|
@@ -35,14 +38,14 @@ on: | |
- '*.md' | ||
- '.github/workflows/*.yml' | ||
# re-include current file to not be excluded | ||
- '!.github/workflows/build-ubuntu-debug-python.yml' | ||
- '!.github/workflows/run-ubuntu-checks.yml' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }}-ubuntu-debug-python | ||
group: ${{ github.workflow }}-${{ github.ref }}-ubuntu-checks | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
debug_python: | ||
debug_coverage: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false # if a particular matrix build fails, don't skip the rest | ||
|
@@ -69,7 +72,7 @@ jobs: | |
# https://github.com/orgs/community/discussions/47863 | ||
run: | | ||
sudo apt-get update --fix-missing | ||
|
||
sudo apt-get install lcov -y | ||
sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libfreetype6-dev libportmidi-dev -y | ||
|
||
- name: Install pyenv | ||
|
@@ -98,7 +101,7 @@ jobs: | |
id: build-pygame-ce | ||
run: | | ||
pyenv global ${{ matrix.python }}-debug | ||
python dev.py build --lax | ||
python dev.py build --lax --coverage | ||
|
||
- name: Run tests | ||
env: | ||
|
@@ -107,3 +110,49 @@ jobs: | |
run: | | ||
pyenv global ${{ matrix.python }}-debug | ||
python -m pygame.tests -v --exclude opengl,music,timing --time_out 300 | ||
|
||
- name: Generate coverage | ||
id: gen-coverage | ||
# want to continue regardless of whether a test failed or not as long as the job wasn't cancelled | ||
if: ${{ steps.build-pygame-ce.conclusion == 'success' && !cancelled() }} | ||
run: | | ||
lcov --capture --directory . --output-file ./coverage.info | ||
genhtml ./coverage.info --output-directory ./out | ||
|
||
# We upload the generated files under github actions assets | ||
- name: Upload coverage html | ||
# want to continue only if the coverage generation was successful | ||
if: ${{ steps.gen-coverage.conclusion == 'success' && !cancelled() }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: pygame-wheels-coverage | ||
path: ./out | ||
|
||
# Run cppcheck static analysis on src_c changes | ||
run-cppcheck: | ||
runs-on: ubuntu-24.04 | ||
needs: debug_coverage | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
|
||
- name: Check if any src_c files changed | ||
id: check-changes | ||
run: | | ||
git fetch origin ${{ github.base_ref }} --depth=1 || true | ||
CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}...HEAD) | ||
echo "$CHANGED_FILES" | grep '^src_c/' || echo "::set-output name=skip::true" | ||
|
||
- name: Install cppcheck | ||
if: steps.check-changes.outputs.skip != 'true' | ||
run: | | ||
sudo apt-get update --fix-missing | ||
sudo apt install cppcheck | ||
|
||
- name: Run Static Checker | ||
if: steps.check-changes.outputs.skip != 'true' | ||
run: cppcheck src_c --enable=performance,portability,warning \ | ||
--suppress=*:src_c/freetype/ft_cache.c --suppress=*:src_c/scrap* \ | ||
--suppress=*:src_c/scale_mmx*.c --suppress=*:src_c/SDL_gfx/* \ | ||
--suppress=missingReturn --suppress=syntaxError -DWITH_THREAD -j $(nproc) \ | ||
-DPG_MAJOR_VERSION -DPG_MINOR_VERSION -DPG_PATCH_VERSION -DPG_VERSION_TAG |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.