Skip to content

Commit

Permalink
Merge branch 'main' into filenotfound
Browse files Browse the repository at this point in the history
  • Loading branch information
illume committed Oct 23, 2021
2 parents fd02e30 + a0521b4 commit 8add1aa
Show file tree
Hide file tree
Showing 170 changed files with 6,330 additions and 2,031 deletions.
158 changes: 158 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
name: Build

# 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: [created]
push:
branches: main
paths-ignore:
- 'docs/**'
- 'examples/**'
- '.gitignore'
- 'README.rst'
- '.github/workflows/manylinux.yml'
- '.github/workflows/sdl1-sdist.yml'

pull_request:
branches: main
paths-ignore:
- 'docs/**'
- 'examples/**'
- '.gitignore'
- 'README.rst'
- '.github/workflows/manylinux.yml'
- '.github/workflows/sdl1-sdist.yml'

jobs:
deps:
runs-on: macos-10.15
steps:
- uses: actions/checkout@v2

- name: Test for Mac Deps cache hit
id: macdep-cache
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/pygame_mac_deps
# The hash of all files in buildconfig manylinux-build and macdependencies is
# the key to the cache. If anything changes here, the deps are built again
key: macdep-${{ hashFiles('buildconfig/manylinux-build/**') }}-${{ hashFiles('buildconfig/macdependencies/*.sh') }}

# build mac deps on cache miss
- name: Build Mac Deps
if: steps.macdep-cache.outputs.cache-hit != 'true'
run: |
brew install coreutils
cd buildconfig/macdependencies
bash ./build_mac_deps.sh
# Uncomment when you want to manually verify the deps by downloading them
# - name: Upload Mac deps
# uses: actions/upload-artifact@v2
# with:
# name: pygame-mac-deps
# path: ${{ github.workspace }}/pygame_mac_deps

build:
name: ${{ matrix.name }}
needs: deps
runs-on: macos-10.15 # ${{ matrix.os }}
strategy:
fail-fast: false # if a particular matrix build fails, don't skip the rest
matrix:
# windows is covered by appveyor for now
# os: [windows-latest, macos-10.15]

# Split job into 5 matrix builds, because GH actions provides 5 concurrent
# builds on macOS
include:
- { name: "MacOS (cp27 & pp27)", cibuildver: 1, pyversions: cp27-* pp27-* }
- { name: "MacOS (cp35 & pp36)", cibuildver: 1, pyversions: cp35-* pp36-* }
- { name: "MacOS (cp36 & cp37)", cibuildver: 2, pyversions: cp36-* cp37-* }
- { name: "MacOS (cp38 & cp39)", cibuildver: 2, pyversions: cp38-* cp39-* }
- { name: "MacOS (cp310 & pp37)", cibuildver: 2, pyversions: cp310-* pp37-* }

# seperate into matrix for concurrency.
# pyver: ['cp27', 'cp35', 'cp36', 'cp37', 'cp38', 'cp39', 'cp310', 'pp27', 'pp36', 'pp37']

# exclude py2 builds on windows, because they don't work due to the
# fact that py2 builds use old compiler. There is a workaround for this
# but is not implemented here because Appveyor can already handle py2
# on windows
# exclude:
# - os: windows-latest
# pyver: 'cp27'
# - os: windows-latest
# pyver: 'pp27'

env:
SDL_VIDEODRIVER: "dummy"
SDL_AUDIODRIVER: "disk"

CIBW_BUILD: ${{ matrix.pyversions }}

CIBW_BEFORE_ALL_MACOS: cd buildconfig/macdependencies && bash ./install_mac_deps.sh

CIBW_BEFORE_BUILD: pip install requests numpy
CIBW_TEST_COMMAND: python -m pygame.tests -v --exclude opengl,timing --time_out 300

# Increase pip debugging output
CIBW_BUILD_VERBOSITY: 2

steps:
- uses: actions/checkout@v2

- name: pip cache
uses: actions/cache@v2
with:
path: ~/Library/Caches/pip # This cache path is only right on mac
key: pip-cache-${{ matrix.name }}

- name: Fetch Mac deps
id: macdep-cache
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/pygame_mac_deps
key: macdep-${{ hashFiles('buildconfig/manylinux-build/**') }}-${{ hashFiles('buildconfig/macdependencies/*.sh') }}

# use cibuildwheel v1 to build on older python versions
- name: Build wheels with CIBuildWheel v1
if: matrix.cibuildver == 1
uses: pypa/cibuildwheel@v1.12.0

# use latest cibuildwheel for newer python versions
- name: Build wheels with CIBuildWheel v2
if: matrix.cibuildver == 2
uses: pypa/cibuildwheel@v2.1.3

# Build universal2 wheels too on an Intel runner.
# Note that the `arm64` part of the `universal2` wheel cannot be
# tested in this configuration.
# uncomment when arm builds are working
# env:
# CIBW_ARCHS_MACOS: "x86_64 universal2"

- uses: actions/upload-artifact@v2
with:
name: pygame-wheels
path: ./wheelhouse/*.whl

# - name: Upload binaries to Github Releases
# if: github.event_name == 'release'
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: ./wheelhouse/*.whl
# tag: ${{ github.ref }}
#
# - name: Upload binaries to PyPI
# if: github.event_name == 'release'
# env:
# TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
# TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
# run: |
# python3 -m pip install twine
# twine upload ./wheelhouse/*.whl
87 changes: 0 additions & 87 deletions .github/workflows/macos.yml

This file was deleted.

23 changes: 17 additions & 6 deletions .github/workflows/manylinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,46 @@ on:
- 'examples/**'
- '.gitignore'
- 'README.rst'
- '.github/workflows/macos.yml'
- '.github/workflows/windows.yml'
- '.github/workflows/build.yml'
- '.github/workflows/sdl1-sdist.yml'

pull_request:
branches: main
paths-ignore:
- 'docs/**'
- 'examples/**'
- '.gitignore'
- 'README.rst'
- '.github/workflows/macos.yml'
- '.github/workflows/windows.yml'
- '.github/workflows/build.yml'
- '.github/workflows/sdl1-sdist.yml'

# TODO: Parallelize this build
jobs:
build-manylinux:
runs-on: ubuntu-18.04
strategy:
fail-fast: false # if a particular matrix build fails, don't skip the rest
matrix:
arch: ['x64', 'x86', 'aarch64']
tag: ['-', '-manylinux-'] # one tag for CPython builds, and another for PyPy

exclude:
# no pypy builds on aarch64 for now
- arch: 'aarch64'
tag: '-manylinux-'

steps:
- uses: actions/checkout@v2.3.4

# setup QEMU only on aarch64 matrix
- name: Set up QEMU
if: ${{ matrix.arch == 'aarch64' }}
id: qemu
uses: docker/setup-qemu-action@v1

- name: Build manylinux wheels
run: |
cd buildconfig/manylinux-build
make pull pull-manylinux wheels wheels-manylinux
make pull${{ matrix.tag }}${{ matrix.arch }} wheels${{ matrix.tag }}${{ matrix.arch }}
cd ../..
mkdir -p dist/
cp buildconfig/manylinux-build/wheelhouse/*.whl dist/
Expand All @@ -51,6 +61,7 @@ jobs:
- name: Upload dist
uses: actions/upload-artifact@v2
with:
name: pygame-manylinux-wheels
path: dist/*.whl

# - name: Upload binaries to Github Releases
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/sdl1-sdist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,17 @@ on:
- 'examples/**'
- '.gitignore'
- 'README.rst'
- '.github/workflows/macos.yml'
- '.github/workflows/windows.yml'
- '.github/workflows/build.yml'
- '.github/workflows/manylinux.yml'

pull_request:
branches: main
paths-ignore:
- 'docs/**'
- 'examples/**'
- '.gitignore'
- 'README.rst'
- '.github/workflows/macos.yml'
- '.github/workflows/windows.yml'
- '.github/workflows/build.yml'
- '.github/workflows/manylinux.yml'

jobs:
Expand All @@ -36,6 +35,8 @@ jobs:

- name: Install deps
run: |
sudo apt-get update --fix-missing
sudo apt-get upgrade
sudo apt-get install python3-dev python3-setuptools python3-numpy python3-opengl libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsmpeg-dev libsdl1.2-dev libportmidi-dev libswscale-dev libavformat-dev libavcodec-dev libtiff5-dev libx11-6 libx11-dev fluid-soundfont-gm timgm6mb-soundfont xfonts-base xfonts-100dpi xfonts-75dpi xfonts-cyrillic fontconfig fonts-freefont-ttf libfreetype6-dev
python3 -m pip install -U pip
python3 -m pip install -U wheel requests
Expand Down Expand Up @@ -78,6 +79,7 @@ jobs:
- name: Upload sdist
uses: actions/upload-artifact@v2
with:
name: pygame-sdist
path: dist/*.tar.gz

# - name: Upload binaries to Github Releases
Expand All @@ -95,4 +97,4 @@ jobs:
# TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
# run: |
# python3 -m pip install twine
# twine upload dist/*.tar.gz
# twine upload dist/*.tar.gz

0 comments on commit 8add1aa

Please sign in to comment.