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

Fix CI #24

Merged
merged 17 commits into from
Aug 25, 2024
16 changes: 0 additions & 16 deletions .github/workflows/clippy.yml

This file was deleted.

88 changes: 28 additions & 60 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,20 @@ jobs:
name: sdist Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install Build Deps
run: sudo apt install libusb-1.0-0-dev
- name: setup pkg-config
run: export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/share/pkgconfig

- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install Latest Rust Nightly
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
override: true
- name: Python Build
run: |
pip install -U setuptools wheel setuptools-rust twine
Expand All @@ -37,21 +41,21 @@ jobs:
run: |
python -m twine upload --skip-existing driver/dist/*
build_manylinux:
name: manylinux Build
name: manylinux2014 Build
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, 3.10, 3.11, 3.12]
python-version: [3.8, 3.9, "3.10", 3.11, 3.12]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Run manylinux Builds
uses: docker://quay.io/pypa/manylinux2010_x86_64
uses: docker://quay.io/pypa/manylinux2014_x86_64
with:
entrypoint: driver/build-wheels.sh
- name: Upload Artifacts
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: dist
name: dist-manylinux2014-${{ matrix.python-version }}
path: driver/dist/
- name: Publish to TestPyPI
env:
Expand All @@ -68,74 +72,38 @@ jobs:
TWINE_PASSWORD: ${{ secrets.test_pypi_password }}
run: |
python -m twine upload --skip-existing driver/dist/*
build_macos:
name: macOS Build
runs-on: macos-latest
strategy:
matrix:
python-version: [3.8, 3.9, 3.10, 3.11, 3.12]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install Latest Rust Nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- name: Python Build
run: |
pip install -U setuptools wheel setuptools-rust twine
cd driver
python setup.py build bdist_wheel
mv dist/cantact-*-macos*.whl $(echo dist/cantact-*-macos*.whl | sed 's/macosx_.*/macosx_10_15_x86_64.macosx_10_14_x86_64.macosx_10_13_x86_64.macosx_10_12_x86_64.whl/')
- name: Upload Artifacts
uses: actions/upload-artifact@v1
with:
name: dist
path: driver/dist
- name: Publish to TestPyPI
env:
TWINE_USERNAME: ericevenchick
TWINE_PASSWORD: ${{ secrets.test_pypi_password }}
TWINE_REPOSITORY: testpypi
run: |
python -m twine upload --skip-existing driver/dist/*
- name: Publish to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
env:
TWINE_USERNAME: ericevenchick
TWINE_PASSWORD: ${{ secrets.test_pypi_password }}
run: |
python -m twine upload --skip-existing driver/dist/*
build_windows:
name: Windows Build
runs-on: windows-latest
runs-on: windows-latest-${{ matrix.python-version }}
strategy:
matrix:
python-version: [3.8, 3.9, 3.10, 3.11, 3.12]
python-version: [3.8, 3.9, "3.10", 3.11, 3.12]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install libusb
run: |
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.bat
./vcpkg integrate install
vcpkg install libusb:x64-windows-static-md
- name: Install Latest Rust Nightly
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
override: true
- name: Python Build
run: |
pip install -U setuptools wheel setuptools-rust twine
cd driver
python setup.py build bdist_wheel
- name: Upload Artifacts
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: dist
name: dist-windows
path: driver/dist
- name: Publish to TestPyPI
env:
Expand Down
29 changes: 16 additions & 13 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,31 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install Build Deps
run: sudo apt install libusb-1.0-0-dev
- name: setup pkg-config
run: export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/share/pkgconfig
- name: Install Latest Nightly
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
override: true
- name: Run Cargo Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release --all-features
run: cargo build --release --all-features
clippy_check:
name: Clippy Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v4
- name: Install Build Deps
run: sudo apt install libusb-1.0-0-dev
- name: setup pkg-config
run: export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/share/pkgconfig
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: clippy
override: true
- uses: actions-rs/clippy-check@v1
- uses: giraffate/clippy-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: 'github-pr-review'
4 changes: 3 additions & 1 deletion driver/build-wheels.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#!/bin/bash
set -ex

yum install -y libusb-devel libusbx-devel

curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly -y
export PATH="$HOME/.cargo/bin:$PATH"

cd driver/

for PYBIN in /opt/python/{cp36-cp36m,cp37-cp37m,cp38-cp38,cp39-cp39,cp310-cp310}/bin; do
for PYBIN in /opt/python/{cp38-cp38,cp39-cp39,cp310-cp310,cp311-cp311,cp312-cp312}/bin; do
export PYTHON_SYS_EXECUTABLE="$PYBIN/python"

"${PYBIN}/python" -m pip install -U setuptools wheel setuptools-rust
Expand Down
Loading