Skip to content

use container for python 2.7 #65

use container for python 2.7

use container for python 2.7 #65

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python CI
on:
push:
branches: [ "main", "dev" ]
pull_request:
branches: [ "main", "dev" ]
jobs:
build-pure-wheel:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install pypa build
run: python -m pip install build
- name: Create wheel
run: python -m build -w .
env:
PYAVB_BUILD_EXT: '0'
- name: Upload wheel
uses: actions/upload-artifact@v3
with:
name: pure-wheel
path: dist/*.whl
build-cython-wheels:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["cp27*", "cp37*", "cp38*", "cp39*", "cp310*"]
steps:
- uses: actions/checkout@v3
- name: Prepare compiler environment for Windows (Python 2.7)
if: matrix.python-version == 'cp27*' && runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
# cibuildwheel 1.12.0 gates Python 2.7 wheels builds
# by using two environment variables, DISTUTILS_USE_SDK and MSSdk.
# https://cibuildwheel.readthedocs.io/en/1.x/cpp_standards/#windows-and-python-27
- name: Set Windows Python 2.7 environment variables
if: matrix.python-version == 'cp27*' && runner.os == 'Windows'
shell: bash
run: |
echo "DISTUTILS_USE_SDK=1" >> $GITHUB_ENV
echo "MSSdk=1" >> $GITHUB_ENV
- name: Build wheels (Python 2.7)
if: matrix.python-version == 'cp27*'
# cibuildwheel 1.12.0 is the last release that supported Python 2.7.
uses: pypa/[email protected]
with:
output-dir: wheelhouse
env:
CIBW_BUILD: ${{ matrix.python-version }}
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2010
CIBW_MANYLINUX_I686_IMAGE: manylinux2010
CIBW_ARCHS_WINDOWS: AMD64 # On windows we will only compile 64 bits wheels.
CIBW_BUILD_VERBOSITY: 1
- name: Build wheels (Python 3)
uses: pypa/[email protected]
if: matrix.python-version != 'cp27*'
with:
output-dir: wheelhouse
env:
CIBW_BUILD: ${{ matrix.python-version }}
CIBW_SKIP: '*musllinux*'
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2010
CIBW_MANYLINUX_I686_IMAGE: manylinux2010
CIBW_BUILD_VERBOSITY: 1
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: cython-wheels
path: ./wheelhouse/*.whl
test-pure-wheel:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-latest, macos-latest]
python-version: ["3.7", "3.8", "3.9", "3.10"]
needs:
- build-pure-wheel
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Download pure wheel
uses: actions/download-artifact@v3
with:
name: pure-wheel
path: dist/
- name: Run Unit Tests
shell: bash
run: |
python -m pip install dist/* --no-index
python -m unittest discover tests -v
test-cython-wheels:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.7", "3.8", "3.9", "3.10"]
needs:
- build-cython-wheels
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Download cython wheels
uses: actions/download-artifact@v3
with:
name: cython-wheels
path: dist/
- name: Run Unit Tests
shell: bash
run: |
python -m pip install --find-links=./dist --no-index --only-binary=:all: pyavb
python -m unittest discover tests -v
test-cython-wheels-27:
runs-on: ubuntu-latest
container: coatldev/six:latest
needs:
- build-cython-wheels
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Download cython wheels
uses: actions/download-artifact@v3
with:
name: cython-wheels
path: dist/
- name: Run Unit Tests
shell: bash
run: |
python --version
python -m pip install --find-links=./dist --no-index --only-binary=:all: pyavb
python -m unittest discover tests -v
latest-release:
needs:
- test-cython-wheels
- test-pure-wheel
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Create sdist
run: |
pip install build
python -m build -s .
- name: Upload sdist
uses: actions/upload-artifact@v3
with:
name: sdist
path: ./dist/*.tar.gz
- name: Download pure wheel
uses: actions/download-artifact@v3
with:
name: pure-wheel
path: dist
- name: Download cython wheels
uses: actions/download-artifact@v3
with:
name: cython-wheels
path: dist
- name: Display structure of downloaded files
run: ls -R
working-directory: dist/
- uses: "marvinpinto/action-automatic-releases@latest"
if: ${{ github.ref == 'refs/heads/main' }}
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
title: "Development Build"
files: |
dist/*.tar.gz
dist/*.whl