Skip to content

TriMap merge

TriMap merge #984

Workflow file for this run

name: CI
on:
pull_request:
branches:
- master
push:
branches:
- master
release:
types: published
jobs:
tar_gz:
name: Package
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@master
with:
python-version: 3.12
- run: pip install -r requirements-build-3_12.txt
- run: python setup.py sdist
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist
matrix_config:
name: Matrix Runner Config
runs-on: ubuntu-22.04
outputs:
matrix_os: ${{ steps.step.outputs.matrix_os }}
steps:
- run: echo "$GITHUB_EVENT_NAME"
- id: step
run: |
if [ "$GITHUB_EVENT_NAME" = "release" ]; then
echo 'matrix_os=["macos-13-xlarge", "macos-13", "ubuntu-22.04", "windows-2022"]' >> $GITHUB_OUTPUT
else
echo 'matrix_os=["macos-13", "ubuntu-22.04", "windows-2022"]' >> $GITHUB_OUTPUT
fi
wheels:
name: Build / ${{ matrix.os }} / Python 3.${{ matrix.python.minor }}
needs: matrix_config
strategy:
fail-fast: false
matrix:
os: ${{ fromJson(needs.matrix_config.outputs.matrix_os) }}
python:
- {minor: 9, req_build: 'requirements-build-3_11.txt', req_test: 'requirements-dev-3_11.txt'}
- {minor: 10, req_build: 'requirements-build-3_11.txt', req_test: 'requirements-dev-3_11.txt'}
- {minor: 11, req_build: 'requirements-build-3_11.txt', req_test: 'requirements-dev-3_11.txt'}
- {minor: 12, req_build: 'requirements-build-3_12.txt', req_test: 'requirements-dev-3_12.txt'}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@master
- run: echo '::add-matcher::.github/problem-matchers/gcc.json'
if: startsWith(matrix.os, 'macos-') || startsWith(matrix.os, 'ubuntu-')
- run: echo '::add-matcher::.github/problem-matchers/msvc.json'
if: startsWith(matrix.os, 'windows-')
- uses: pypa/cibuildwheel@v2.18.0
if: matrix.os != 'macos-13-xlarge'
with:
output-dir: dist
env:
CIBW_BUILD: cp3${{ matrix.python.minor }}-*
CIBW_ARCHS_WINDOWS: x86 AMD64
CIBW_ARCHS_MACOS: x86_64
CIBW_BEFORE_BUILD: pip install -r {project}/${{ matrix.python.req_build }}
CIBW_BEFORE_TEST: pip install -r {project}/${{ matrix.python.req_test }}
CIBW_TEST_COMMAND: pytest {project}/test
- run: pip install pipx
if: matrix.os == 'macos-13-xlarge'
- uses: pypa/cibuildwheel@v2.18.0
if: matrix.os == 'macos-13-xlarge'
with:
output-dir: dist
env:
CIBW_BUILD: cp3${{ matrix.python.minor }}-macosx_arm64
CIBW_BEFORE_BUILD: pip install -r {project}/${{ matrix.python.req_build }}
CIBW_BEFORE_TEST: pip install -r {project}/${{ matrix.python.req_test }}
CIBW_TEST_COMMAND: pytest {project}/test
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist
upload:
name: Publish
if: github.event_name == 'release'
needs: [tar_gz, wheels]
runs-on: ubuntu-22.04
steps:
- uses: actions/download-artifact@v3
with:
name: dist
path: dist
- uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_TOKEN }}
skip_existing: true