Skip to content

Publish wheel files to pypi #72

Publish wheel files to pypi

Publish wheel files to pypi #72

Workflow file for this run

name: Run Tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
formatting:
name: Check Formatting
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install Formatting
run: |
python -m pip install --upgrade pip
pip install hacking isort
- name: Check Formatting
run: |
flake8 .
grep -rlIP '[^\x00-\x7F]' pysdfgen | grep '\.pyx\?' | sort > unicode.out; grep -rlI '# -\*- coding: \(utf-8\|latin-1\) -\*-' pysdfgen | grep '\.pyx\?' | sort > coding.out; comm -23 unicode.out coding.out > test_code.out; cat test_code.out; test \! -s test_code.out
- name: Check isort
run: |
isort -c .
tests-3x:
name: Run Unit Tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.6.15, 3.8.16, 3.10.10]
os: [ubuntu-20.04]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Checkout submodules
shell: bash
run: |
git submodule sync --recursive
git submodule update --init --force --recursive
- name: Install Pytest
run: |
python -m pip install --upgrade pip setuptools wheel
pip install pytest hacking
- name: Install pysdfgen
run: pip install .
- name: Run Pytest
run: pytest -v tests
tests-2x:
name: Run Unit Tests
runs-on: ubuntu-20.04
container:
image: python:2.7.18-buster
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install APT On Linux
run: |
apt-get update -qq -y
apt-get install -qq -y cmake
- name: Checkout submodules
shell: bash
run: |
git submodule sync --recursive
git submodule update --init --force --recursive
- name: Install Pytest
run: |
python -m pip install --upgrade pip setuptools wheel
pip install pytest hacking
- name: Install pysdfgen
run: pip install .
- name: Run Pytest
run: pytest -v tests
pypi:
name: Release To PyPi
needs: [formatting, tests-2x, tests-3x]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Build wheels
uses: pypa/cibuildwheel@v2.16.2
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz
upload_pypi:
needs: [build_wheels, build_sdist]

Check failure on line 126 in .github/workflows/test.yml

View workflow run for this annotation

GitHub Actions / Run Tests

Invalid workflow file

The workflow is not valid. .github/workflows/test.yml (Line: 126, Col: 13): Job 'upload_pypi' depends on unknown job 'build_wheels'.
runs-on: ubuntu-latest
environment: pypi
steps:
- uses: actions/download-artifact@v4
with:
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}