Skip to content

CI test

CI test #26

Workflow file for this run

name: Continuous Integration
on: [push, pull_request]
jobs:
build:
strategy:
# Allows for matrix sub-jobs to fail without canceling the rest
fail-fast: false
matrix:
os:
# - windows-2019
- ubuntu-latest
# - macos-11
# - macos-latest
python-version: [ {cpver: "cp311*", py: "3.11"}]
#python-version:
# - "3.12"
# - "3.11"
lua-version:
- "bundle"
# exclude:
runs-on: ${{ matrix.os }}
env:
CFLAGS_LTO: ${{ contains(matrix.lua-version, 'bundle') && (contains(matrix.os, 'windows') && '/LTCG' || '-flto') || '' }}
CFLAGS: ${{ contains(matrix.os, 'windows') && '/O2' || '-O2 -fPIC' }} -g
MACOSX_DEPLOYMENT_TARGET: "11.0"
LUPA_WITH_LUA_DLOPEN: ${{ startsWith(matrix.os, 'windows') && 'false' || 'true' }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version.py }}
if: ${{ !startsWith(matrix.os, 'ubuntu') || startsWith(matrix.python-version.py, '3.') || startsWith(matrix.python-version.py, 'pypy') }}
uses: actions/setup-python@v4
with:
python-version.py: ${{ matrix.python-version.py }}
- name: Set up Python packages
run: |
python -m pip install -U pip setuptools
python -m pip install -U wheel tox virtualenv -r requirements.txt
- name: Build wheel
if: ${{ !startsWith(matrix.os, 'ubuntu') }}
run: python setup.py sdist ${{ contains(matrix.python-version.py, '3.') && 'build_ext -j6' || '' }} bdist_wheel
env:
SETUP_OPTIONS: --use-bundle --no-luajit
CFLAGS: ${{ env.CFLAGS }} ${{ env.CFLAGS_LTO }}
LDFLAGS: ${{ env.CFLAGS_LTO }}
- name: Build Linux wheels
if: ${{ startsWith(matrix.os, 'ubuntu') }}
run: make USE_BUNDLE=true sdist wheel_manylinux2014_x86_64
env: { PYTHON_BUILD_VERSION: "${{ matrix.python-version.cpver }}" }
- name: Run tests
run: python setup.py test
env:
SETUP_OPTIONS: --use-bundle --no-luajit
CFLAGS: ${{ env.CFLAGS }} ${{ env.CFLAGS_LTO }}
LDFLAGS: ${{ env.CFLAGS_LTO }}
- name: Upload wheels
if: ${{ contains(matrix.lua-version, 'bundle') }}
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.python-version.py }}-${{ matrix.os }}
path: dist/*.whl
if-no-files-found: ignore
publish-to-testpypi:
name: Publish Python 🐍 distribution 📦 to TestPyPI
needs:
- build
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/randovania-lupa
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
merge-multiple: true
path: dist/
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/