Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework of the Github Actions #46

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Build and Deploy Package (New)

on:
push:
branches: [ master ]
release:
types: [ created ]
pull_request:
branches: [ master ]

jobs:
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
fetch-depth: 0

- name: Build sdist
run: |
pip install -r requirements.txt
python setup.py sdist

- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz

build_wheels:
name: Build wheels on ${{ matrix.os }} CIBW_BUILD=${{ matrix.cibw_build }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
cibw_build: [cp38-*, cp39-*, cp310-*, cp311-*]
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: "recursive"
fetch-depth: 0

- name: Setup QEMU # Needed to build aarch64 wheels
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
with:
platforms: all

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS_LINUX: "x86_64 i686 aarch64"
CIBW_ARCHS_MACOS: "x86_64 arm64"
CIBW_ARCHS_WINDOWS: "AMD64 x86"
CIBW_BUILD: ${{ matrix.cibw_build }}
CIBW_SKIP: "pp* *-musllinux_aarch64" # Don't build musllinux wheels for aarch64
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: "pytest {project}/test"
CIBW_TEST_SKIP: "*-macosx_arm64" # Testing on Apple Silicon currently not supported.

- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl


upload_pypi:
needs: [build_sdist, build_wheels]
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.pypi_api_token }}
5 changes: 3 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,22 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]
python-version: [3.8, 3.9, "3.10", "3.11"]

steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest
pip install -r requirements.txt
pip install -e .
- name: Test with pytest
run: |
Expand Down