Python bindings checks #349
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Python bindings checks | |
on: | |
push: | |
branches: [develop, production] | |
paths: | |
- ".github/actions/**" | |
- "**.rs" # Include all rust files | |
- "**Cargo.toml" # Include all Cargo.toml files | |
- "**Cargo.lock" # Include all Cargo.lock files | |
- "!**/examples/**" # Exclude all examples | |
- "!**/tests/**" # Exclude all tests | |
- "!cli/**" # Exclude CLI | |
- "!**/bindings/**" # Exclude all bindings | |
- "bindings/python/**" | |
- ".github/workflows/bindings-python.yml" | |
pull_request: | |
branches: [develop, production] | |
paths: | |
- ".github/actions/**" | |
- "**.rs" # Include all rust files | |
- "**Cargo.toml" # Include all Cargo.toml files | |
- "**Cargo.lock" # Include all Cargo.lock files | |
- "!**/examples/**" # Exclude all examples | |
- "!**/tests/**" # Exclude all tests | |
- "!cli/**" # Exclude CLI | |
- "!**/bindings/**" # Exclude all bindings | |
- "bindings/python/**" | |
- ".github/workflows/bindings-python.yml" | |
schedule: | |
- cron: "0 1 * * *" | |
workflow_dispatch: | |
env: | |
CARGO_INCREMENTAL: 0 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
name: Test | |
if: ${{ ! github.event.schedule }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
# os: [windows-latest, macos-latest, ubuntu-latest] | |
os: [windows-latest, ubuntu-latest] | |
python-version: ["3.10"] | |
steps: | |
- name: Checkout the Source Code | |
uses: actions/checkout@v3 | |
- name: Set up Rust | |
uses: ./.github/actions/setup-rust | |
with: | |
cache-root: bindings/python | |
- name: Set Up Python ${{ matrix.python-version }} and Pip Cache | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: pip | |
cache-dependency-path: bindings/python/requirements-dev.txt | |
# This step is required for bindgen to work on Windows. | |
- name: Set Up Clang/LLVM (Windows) | |
if: ${{ startsWith(matrix.os, 'windows') }} | |
uses: ./.github/actions/setup-clang | |
- name: Install Dependencies for Python Binding Tests | |
run: | | |
python3 -m pip install --upgrade setuptools pip wheel | |
python3 -m pip install tox-gh-actions | |
- name: Install required packages (Ubuntu) | |
if: ${{ startsWith(matrix.os, 'ubuntu') }} | |
run: | | |
sudo apt-get update | |
sudo apt-get install libudev-dev libusb-1.0-0-dev | |
- name: Run Tox | |
working-directory: bindings/python | |
run: tox |