-
-
Notifications
You must be signed in to change notification settings - Fork 158
96 lines (83 loc) · 2.98 KB
/
build-ubuntu-sdist.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# 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:
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
paths-ignore:
- 'docs/**'
- 'examples/**'
- '.gitignore'
- '*.rst'
- '*.md'
- '.github/workflows/*.yml'
# re-include current file to not be excluded
- '!.github/workflows/build-ubuntu-sdist.yml'
# the github release drafter can call this workflow
workflow_call:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-ubuntu-sdist
cancel-in-progress: true
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # if a particular matrix build fails, don't skip the rest
matrix:
os: [ubuntu-22.04]
env:
# Pip now forces us to either make a venv or set this flag, so we will do
# this
PIP_BREAK_SYSTEM_PACKAGES: 1
# We are using dependencies installed from apt
PG_DEPS_FROM_SYSTEM: 1
steps:
- uses: actions/[email protected]
- name: Install deps
# install numpy from pip and not apt because the one from pip is newer,
# and has typestubs
# https://github.com/actions/runner-images/issues/7192
# https://github.com/orgs/community/discussions/47863
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 python3-dev
pip3 install --upgrade pip
pip3 install build numpy>=1.21.0
- name: Make sdist and install it
run: |
python3 -m build --sdist --outdir dist .
pip3 install dist/pygame_ce-*.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
run: |
pip3 install mypy
python3 buildconfig/stubs/stubcheck.py
# We upload the generated files under github actions assets
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: pygame-wheels-sdist
path: dist/*.tar.gz
compression-level: 0 # already compressed, no need for more compression