Skip to content

Bump pypa/cibuildwheel from 2.11.3 to 2.14.1 #99

Bump pypa/cibuildwheel from 2.11.3 to 2.14.1

Bump pypa/cibuildwheel from 2.11.3 to 2.14.1 #99

Workflow file for this run

name: Tests
on: [push, pull_request]
jobs:
build_sdist:
name: Build source wheels
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/[email protected]
with:
python-version: 3.8
- name: Upgrade pip
run: |-
python -m pip install --upgrade pip
python -m pip install setuptools>=0.8 wheel build
- name: Build sdist
shell: bash
run: |-
python -m build --sdist --outdir wheelhouse
- name: Install sdist
run: |-
ls -al ./wheelhouse
pip install pytest pytest-cov
pip install Cython
pip install wheelhouse/*.tar.gz -v
- name: Test sdist
run: |-
pwd
ls -al
# Run in a sandboxed directory
WORKSPACE_DNAME="testsrcdir_minimal_${CI_PYTHON_VERSION}_${GITHUB_RUN_ID}_${RUNNER_OS}"
mkdir -p $WORKSPACE_DNAME
cd $WORKSPACE_DNAME
# Get path to installed package
MOD_NAME=lark_cython
MOD_DPATH=$(python -c "import $MOD_NAME, os; print(os.path.dirname($MOD_NAME.__file__))")
echo "MOD_DPATH = $MOD_DPATH"
# Run the tests
python -m pytest --cov=$MOD_NAME $MOD_DPATH ../tests
cd ..
- name: Upload sdist artifact
uses: actions/upload-artifact@v3
with:
name: wheels
path: ./wheelhouse/*.tar.gz
build_binary_wheels:
name: ${{ matrix.os }}, arch=${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["windows-latest", "ubuntu-latest", "macOS-latest"]
cibw_skip: ["*-win32"]
arch: [auto]
include:
- os: windows-latest
arch: auto
cibw_skip: '*-win_amd64'
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Enable MSVC 64bit
uses: ilammy/msvc-dev-cmd@v1
if: matrix.os == 'windows-latest' && matrix.cibw_skip == '*-win32'
- name: Enable MSVC 32bit
uses: ilammy/msvc-dev-cmd@v1
if: matrix.os == 'windows-latest' && matrix.cibw_skip == '*-win_amd64'
with:
arch: x86
- name: Build binary wheels
uses: pypa/[email protected]
with:
output-dir: wheelhouse
config-file: pyproject.toml
env:
CIBW_BUILD_VERBOSITY: 1
#CIBW_TEST_COMMAND: pytest
CIBW_SKIP: ${{ matrix.cibw_skip }}
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
- name: Show built files
shell: bash
run: ls -la wheelhouse
- name: Set up Python 3.8 to combine coverage Linux
uses: actions/[email protected]
if: runner.os == 'Linux'
with:
python-version: 3.8
- name: Combine coverage Linux
if: runner.os == 'Linux'
run: |-
echo '############ PWD'
pwd
cp .wheelhouse/.coverage* . || true
ls -al
python -m pip install coverage[toml]
echo '############ combine'
coverage combine . || true
echo '############ XML'
coverage xml -o ./tests/coverage.xml || true
echo '############ FIND'
find . -name .coverage.* || true
find . -name coverage.xml || true
- uses: codecov/codecov-action@v3
name: Codecov Upload
with:
file: ./tests/coverage.xml
- uses: actions/upload-artifact@v3
name: Upload wheels artifact
with:
name: wheels
path: ./wheelhouse/*.whl
publish_wheels:
name: Publish Wheels
runs-on: ubuntu-latest
needs:
- build_binary_wheels
- build_sdist
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Download wheels and sdist
uses: actions/download-artifact@v3
with:
name: wheels
path: wheelhouse
- name: Show files to upload
shell: bash
run: ls -la wheelhouse
### See github action page for details
# https://github.com/marketplace/actions/pypi-publish
# ----
- name: Publish to Live PyPI
# Only publish real wheels for new git tags.
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
skip_existing: true
#repository_url: https://upload.pypi.org/legacy/ # default url should be fine
packages_dir: wheelhouse
verbose: true
# ----
- name: Publish to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: github.event_name == 'push' && ! startsWith(github.event.ref, 'refs/tags')
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
skip_existing: true
repository_url: https://test.pypi.org/legacy/
packages_dir: wheelhouse
verbose: true