-
Notifications
You must be signed in to change notification settings - Fork 577
138 lines (131 loc) · 4.68 KB
/
Copy pathbindings_python_ci.yml
File metadata and controls
138 lines (131 loc) · 4.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
name: Bindings Python CI
on:
push:
branches:
- main
paths:
- '**' # Include all files and directories in the repository by default.
- '!.github/ISSUE_TEMPLATE/**' # Exclude files and directories that don't impact tests or code like templates, metadata, and documentation.
- '!dev/release/**'
- '!website/**'
- '!.asf.yml'
- '!.gitattributes'
- '!.gitignore'
- '!CONTRIBUTING.md'
- '!CHANGELOG.md'
- '!LICENSE'
- '!NOTICE'
- '!README.md'
pull_request:
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
permissions:
contents: read
jobs:
check-python:
runs-on: ubuntu-slim
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
version: "0.9.3"
enable-cache: true
- name: Install tools
run: |
uv tool install ruff@0.15.22
- name: Check format
working-directory: "bindings/python"
run: |
uvx ruff format . --diff
- name: Check style
working-directory: "bindings/python"
run: |
uvx ruff check .
test:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 15
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: 3.12
# Linux maturin builds may run inside manylinux Docker, so host Rust caches only help Windows/macOS.
- name: Setup Rust toolchain
if: runner.os != 'Linux'
uses: $/.github/actions/setup-builder
- name: Cache Rust artifacts
if: runner.os != 'Linux'
uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
with:
key: bindings-python
save-if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
- uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
with:
working-directory: "bindings/python"
command: build
args: --out dist -i python3.12 # Explicitly set interpreter; manylinux containers have multiple Pythons and maturin may pick an older one
- uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
version: "0.9.3"
enable-cache: true
- name: Sync dependencies
working-directory: "bindings/python"
shell: bash
run: |
uv sync --group dev --no-install-project
- name: Install built wheel
working-directory: "bindings/python"
shell: bash
# --no-index keeps resolution inside dist/: --find-links alone only adds a
# source, so a newer PyPI release would win and be tested instead.
run: |
uv pip install --no-build --reinstall --no-index --find-links dist/ pyiceberg-core
- name: Run tests
working-directory: "bindings/python"
shell: bash
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
HF_DATASET: ${{ secrets.HF_DATASET }}
run: |
make test
bindings-python-ci-required:
if: ${{ always() }}
needs: [check-python, test]
runs-on: ubuntu-slim
steps:
- name: Verify Bindings Python CI jobs succeeded
env:
RESULTS: ${{ join(needs.*.result, ' ') }}
run: |
read -ra results <<< "$RESULTS"
for result in "${results[@]}"; do
test "$result" = "success"
done