1# Build and test the python package 2name: Python build and test 3 4on: 5 push: 6 branches: [ main ] 7 pull_request: 8 branches: [ main ] 9 10permissions: 11 contents: read 12 13jobs: 14 build: 15 runs-on: ${{ matrix.os }} 16 strategy: 17 matrix: 18 os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] 19 python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] 20 fail-fast: false 21 22 steps: 23 - name: Check out from Git 24 uses: actions/checkout@v3 25 - name: Get history and tags for SCM versioning to work 26 run: | 27 git fetch --prune --unshallow 28 git fetch --depth=1 origin +refs/tags/*:refs/tags/* 29 - name: Set up Python ${{ matrix.python-version }} 30 uses: actions/setup-python@v4 31 with: 32 python-version: ${{ matrix.python-version }} 33 - name: Install dependencies 34 run: | 35 python -m pip install --upgrade pip 36 python -m pip install ".[build,test,development,documentation]" 37 - name: Test 38 run: | 39 invoke test 40 - name: Build 41 run: | 42 inv build 43 inv build.mkdocs 44 45 build-rust: 46 runs-on: ubuntu-latest 47 strategy: 48 matrix: 49 python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ] 50 rust-version: [ "1.76.0", "stable" ] 51 fail-fast: false 52 steps: 53 - name: Check out from Git 54 uses: actions/checkout@v3 55 - name: Set up Python ${{ matrix.python-version }} 56 uses: actions/setup-python@v4 57 with: 58 python-version: ${{ matrix.python-version }} 59 - name: Install Python dependencies 60 run: | 61 python -m pip install --upgrade pip 62 python -m pip install ".[build,test,development,documentation]" 63 - name: Install Rust toolchain 64 uses: actions-rust-lang/setup-rust-toolchain@v1 65 with: 66 components: clippy,rustfmt 67 toolchain: ${{ matrix.rust-version }} 68 - name: Install Rust dependencies 69 run: cargo install cargo-all-features # allows building/testing combinations of features 70 - name: Check License Headers 71 run: cd rust && cargo run --features dev-tools --bin file-header check-all 72 - name: Rust Build 73 run: cd rust && cargo build --all-targets && cargo build-all-features --all-targets 74 # Lints after build so what clippy needs is already built 75 - name: Rust Lints 76 run: cd rust && cargo fmt --check && cargo clippy --all-targets -- --deny warnings && cargo clippy --all-features --all-targets -- --deny warnings 77 - name: Rust Tests 78 run: cd rust && cargo test-all-features 79 # At some point, hook up publishing the binary. For now, just make sure it builds. 80 # Once we're ready to publish binaries, this should be built with `--release`. 81 - name: Build Bumble CLI 82 run: cd rust && cargo build --features bumble-tools --bin bumble