|
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +# or more contributor license agreements. See the NOTICE file |
| 3 | +# distributed with this work for additional information |
| 4 | +# regarding copyright ownership. The ASF licenses this file |
| 5 | +# to you under the Apache License, Version 2.0 (the |
| 6 | +# "License"); you may not use this file except in compliance |
| 7 | +# with the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, |
| 12 | +# software distributed under the License is distributed on an |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +# KIND, either express or implied. See the License for the |
| 15 | +# specific language governing permissions and limitations |
| 16 | +# under the License. |
| 17 | + |
| 18 | +name: Bindings Python CI |
| 19 | + |
| 20 | +on: |
| 21 | + push: |
| 22 | + branches: |
| 23 | + - main |
| 24 | + pull_request: |
| 25 | + branches: |
| 26 | + - main |
| 27 | + |
| 28 | +concurrency: |
| 29 | + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} |
| 30 | + cancel-in-progress: true |
| 31 | + |
| 32 | +jobs: |
| 33 | + check-rust: |
| 34 | + runs-on: ubuntu-latest |
| 35 | + steps: |
| 36 | + - uses: actions/checkout@v4 |
| 37 | + - name: Check format |
| 38 | + run: cargo fmt --all -- --check |
| 39 | + - name: Check clippy |
| 40 | + run: cargo clippy --all-targets --all-features -- -D warnings |
| 41 | + |
| 42 | + check-python: |
| 43 | + runs-on: ubuntu-latest |
| 44 | + steps: |
| 45 | + - uses: actions/checkout@v4 |
| 46 | + - name: Install tools |
| 47 | + run: | |
| 48 | + pip install ruff |
| 49 | + - name: Check format |
| 50 | + working-directory: "bindings/python" |
| 51 | + run: | |
| 52 | + ruff format . --diff |
| 53 | + - name: Check style |
| 54 | + working-directory: "bindings/python" |
| 55 | + run: | |
| 56 | + ruff check . |
| 57 | +
|
| 58 | + test: |
| 59 | + runs-on: ${{ matrix.os }} |
| 60 | + strategy: |
| 61 | + matrix: |
| 62 | + os: |
| 63 | + - ubuntu-latest |
| 64 | + - macos-latest |
| 65 | + - windows-latest |
| 66 | + steps: |
| 67 | + - uses: actions/checkout@v4 |
| 68 | + - uses: actions/setup-python@v4 |
| 69 | + with: |
| 70 | + python-version: 3.8 |
| 71 | + - uses: PyO3/maturin-action@v1 |
| 72 | + with: |
| 73 | + working-directory: "bindings/python" |
| 74 | + command: build |
| 75 | + args: --out dist --sdist |
| 76 | + - name: Run tests |
| 77 | + working-directory: "bindings/python" |
| 78 | + shell: bash |
| 79 | + run: | |
| 80 | + set -e |
| 81 | + pip install dist/pyiceberg_core-*.whl --force-reinstall |
| 82 | + pip install pytest |
| 83 | + pytest -v |
0 commit comments