Skip to content

Commit d1295f7

Browse files
authored
improve rust workflows without cache (#1275)
* clean up CI * streamline workflow concurrency
1 parent 3cd58fc commit d1295f7

File tree

11 files changed

+235
-254
lines changed

11 files changed

+235
-254
lines changed

.github/actions/setup-builder/action.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ inputs:
2525
runs:
2626
using: "composite"
2727
steps:
28-
- name: Install Build Dependencies
28+
- name: Install protobuf compiler
2929
shell: bash
3030
run: |
3131
apt-get update
@@ -37,3 +37,5 @@ runs:
3737
rustup toolchain install ${{ inputs.rust-version }}
3838
rustup default ${{ inputs.rust-version }}
3939
rustup component add rustfmt
40+
- name: Configure rust runtime env
41+
uses: ./.github/actions/setup-rust-runtime
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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: Prepare Rust Builder for MacOS
19+
description: 'Prepare Rust Build Environment for MacOS'
20+
inputs:
21+
rust-version:
22+
description: 'version of rust to install (e.g. stable)'
23+
required: true
24+
default: 'stable'
25+
runs:
26+
using: "composite"
27+
steps:
28+
- name: Install protobuf compiler
29+
shell: bash
30+
run: |
31+
mkdir -p $HOME/d/protoc
32+
cd $HOME/d/protoc
33+
export PROTO_ZIP="protoc-29.1-osx-x86_64.zip"
34+
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v29.1/$PROTO_ZIP
35+
unzip $PROTO_ZIP
36+
echo "$HOME/d/protoc/bin" >> $GITHUB_PATH
37+
export PATH=$PATH:$HOME/d/protoc/bin
38+
protoc --version
39+
- name: Setup Rust toolchain
40+
shell: bash
41+
run: |
42+
rustup update stable
43+
rustup toolchain install stable
44+
rustup default stable
45+
rustup component add rustfmt
46+
- name: Configure rust runtime env
47+
uses: ./.github/actions/setup-rust-runtime
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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: Setup Rust Runtime
19+
description: 'Setup Rust Runtime Environment'
20+
runs:
21+
using: "composite"
22+
steps:
23+
# https://github.com/apache/datafusion/issues/15535
24+
# disabled because neither version nor git hash works with apache github policy
25+
#- name: Run sccache-cache
26+
# uses: mozilla-actions/sccache-action@65101d47ea8028ed0c98a1cdea8dd9182e9b5133 # v0.0.8
27+
- name: Configure runtime env
28+
shell: bash
29+
# do not produce debug symbols to keep memory usage down
30+
# hardcoding other profile params to avoid profile override values
31+
# More on Cargo profiles https://doc.rust-lang.org/cargo/reference/profiles.html?profile-settings#profile-settings
32+
#
33+
# Set debuginfo=line-tables-only as debuginfo=0 causes immensely slow build
34+
# See for more details: https://github.com/rust-lang/rust/issues/119560
35+
#
36+
# readd the following to the run below once sccache-cache is re-enabled
37+
# echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
38+
# echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
39+
run: |
40+
echo "RUST_BACKTRACE=1" >> $GITHUB_ENV
41+
echo "RUSTFLAGS=-C debuginfo=line-tables-only -C incremental=false" >> $GITHUB_ENV
42+
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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: Prepare Rust Builder for Windows
19+
description: 'Prepare Rust Build Environment for Windows'
20+
inputs:
21+
rust-version:
22+
description: 'version of rust to install (e.g. stable)'
23+
required: true
24+
default: 'stable'
25+
runs:
26+
using: "composite"
27+
steps:
28+
- name: Install protobuf compiler
29+
shell: bash
30+
run: |
31+
mkdir -p $HOME/d/protoc
32+
cd $HOME/d/protoc
33+
export PROTO_ZIP="protoc-29.1-win64.zip"
34+
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v29.1/$PROTO_ZIP
35+
unzip $PROTO_ZIP
36+
export PATH=$PATH:$HOME/d/protoc/bin
37+
protoc.exe --version
38+
- name: Setup Rust toolchain
39+
shell: bash
40+
run: |
41+
# Avoid self update to avoid CI failures: https://github.com/apache/datafusion/issues/9653
42+
rustup toolchain install stable --no-self-update
43+
rustup default stable
44+
rustup component add rustfmt
45+
- name: Configure rust runtime env
46+
uses: ./.github/actions/setup-rust-runtime

.github/workflows/build.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
# under the License.
1717

1818
name: Python Release Build
19+
20+
concurrency:
21+
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}
22+
cancel-in-progress: true
23+
1924
on:
2025
pull_request:
2126
branches: ["main"]

.github/workflows/cancel.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

.github/workflows/dev.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
name: Dev
1919
on: [push, pull_request]
2020

21+
concurrency:
22+
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}
23+
cancel-in-progress: true
24+
2125
jobs:
2226
rat:
2327
name: Release Audit Tool (RAT)

.github/workflows/dev_pr.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717

1818
name: Labeler
1919

20+
concurrency:
21+
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}
22+
cancel-in-progress: true
23+
2024
on:
2125
pull_request_target:
2226
types:

.github/workflows/docker.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
name: Docker
1919
on: [pull_request, push]
2020

21+
concurrency:
22+
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}
23+
cancel-in-progress: true
24+
2125
jobs:
2226
build_docker:
2327
name: Run Build Docker Script

0 commit comments

Comments
 (0)