Skip to content

Commit 62dce7a

Browse files
committed
CI: Add a new run to check whether lock file is up-to-date
1 parent 88eadc4 commit 62dce7a

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

.github/workflows/rust.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,15 @@ jobs:
356356
rustup component add clippy
357357
- name: Run clippy
358358
run: ci/scripts/rust_clippy.sh
359+
- name: Check Cargo.lock for datafusion-cli
360+
run: |
361+
# This operation is not particularly expensive, but it is not free either
362+
# and since this happens very rarely we can simply guard it off for the
363+
# cases where Cargo.toml has changed.
364+
git diff --name-only origin/$GITHUB_BASE_REF.. \
365+
| grep -qE 'Cargo.toml' \
366+
&& ./ci/scripts/rust_cargo_lock.sh \
367+
|| true
359368
360369
# Check answers are correct when hash values collide
361370
hash-collisions:

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ cpp/Brewfile.lock.json
8585
target
8686
Cargo.lock
8787
!datafusion-cli/Cargo.lock
88-
!ballista-cli/Cargo.lock
8988

9089
rusty-tags.vi
9190
.history

ci/scripts/rust_cargo_lock.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Licensed to the Apache Software Foundation (ASF) under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The ASF licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
19+
20+
# Check whether the Cargo.lock is up-to-date in the datafusion-cli
21+
# since it is the only crate that has a Cargo.lock file checked in.
22+
set -ex
23+
cargo check --manifest-path datafusion-cli/Cargo.toml --locked

0 commit comments

Comments
 (0)