-
Notifications
You must be signed in to change notification settings - Fork 795
145 lines (134 loc) · 4.74 KB
/
rust.yml
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
139
140
141
142
143
144
145
# 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.
# workspace wide tests
name: rust
concurrency:
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true
# trigger for all PRs and changes to master
on:
push:
branches:
- master
pull_request:
jobs:
# Check workspace wide compile and test with default features for
# mac
macos:
name: Test on Mac
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install protoc with brew
run: brew install protobuf
- name: Setup Rust toolchain
run: |
rustup toolchain install stable --no-self-update
rustup default stable
- name: Run tests
shell: bash
run: |
# do not produce debug symbols to keep memory usage down
export RUSTFLAGS="-C debuginfo=0"
cargo test
# Check workspace wide compile and test with default features for
# windows
windows:
name: Test on Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install protobuf compiler in /d/protoc
shell: bash
run: |
mkdir /d/protoc
cd /d/protoc
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v21.4/protoc-21.4-win64.zip
unzip protoc-21.4-win64.zip
export PATH=$PATH:/d/protoc/bin
protoc --version
- name: Setup Rust toolchain
run: |
rustup toolchain install stable --no-self-update
rustup default stable
- name: Run tests
shell: bash
run: |
# do not produce debug symbols to keep memory usage down
export RUSTFLAGS="-C debuginfo=0"
export PATH=$PATH:/d/protoc/bin
cargo test
# Run cargo fmt for all crates
lint:
name: Lint (cargo fmt)
runs-on: ubuntu-latest
container:
image: amd64/rust
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
- name: Setup rustfmt
run: rustup component add rustfmt
- name: Format arrow
run: cargo fmt --all -- --check
- name: Format parquet
# Many modules in parquet are skipped, so check parquet separately. If this check fails, run:
# cargo fmt -p parquet -- --config skip_children=true `find ./parquet -name "*.rs" \! -name format.rs`
# from the top level arrow-rs directory and check in the result.
# https://github.com/apache/arrow-rs/issues/6179
working-directory: parquet
run: cargo fmt -p parquet -- --check --config skip_children=true `find . -name "*.rs" \! -name format.rs`
- name: Format object_store
working-directory: object_store
run: cargo fmt --all -- --check
msrv:
name: Verify MSRV
runs-on: ubuntu-latest
container:
image: amd64/rust
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
- name: Install cargo-msrv
run: cargo install cargo-msrv
- name: Downgrade arrow dependencies
run: cargo update -p ahash --precise 0.8.7
- name: Check arrow
working-directory: arrow
run: cargo msrv --log-target stdout verify
- name: Check parquet
working-directory: parquet
run: cargo msrv --log-target stdout verify
- name: Check arrow-flight
working-directory: arrow-flight
run: cargo msrv --log-target stdout verify
- name: Downgrade object_store dependencies
working-directory: object_store
# Necessary because tokio 1.30.0 updates MSRV to 1.63
# and url 2.5.1, updates to 1.67
run: |
cargo update -p tokio --precise 1.29.1
cargo update -p url --precise 2.5.0
- name: Check object_store
working-directory: object_store
run: cargo msrv --log-target stdout verify