forked from vortex-data/vortex
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
65 lines (58 loc) · 2.34 KB
/
action.yml
File metadata and controls
65 lines (58 loc) · 2.34 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
name: "Setup Rust"
description: "Toolchain setup and Initial compilation"
inputs:
repo-token:
description: "GitHub token for accessing the repository (typically secrets.GITHUB_TOKEN)"
required: false
default: "${{ github.token }}"
toolchain:
description: "optional override for the toolchain version (e.g. nightly)"
required: false
components:
description: "optional override for the components to install for the step (e.g. clippy, rustfmt, miri)"
required: false
targets:
description: "optional targets override (e.g. wasm32-unknown-unknown)"
required: false
cache-suffix:
description: "optional suffix for cache key to isolate builds with different RUSTFLAGS (e.g. 'sanitizer')"
required: false
default: ""
runs:
using: "composite"
steps:
- name: Resolve Toolchain Config
id: toolchain-config
shell: bash
run: |
DEFAULT_VERSION=$(grep channel rust-toolchain.toml | awk -F'"' '{print $2}')
TOOLCHAIN="${TOOLCHAIN_OVERRIDE:-$DEFAULT_VERSION}"
echo "toolchain=$TOOLCHAIN" >> $GITHUB_OUTPUT
echo "targets=$TARGETS" >> $GITHUB_OUTPUT
env:
TOOLCHAIN_OVERRIDE: ${{ inputs.toolchain }}
TARGETS: ${{ inputs.targets }}
- name: Install Mold
if: runner.os == 'Linux'
uses: rui314/setup-mold@v1
- name: Rust Toolchain
id: rust-toolchain
uses: dtolnay/rust-toolchain@stable
if: steps.rustup-cache.outputs.cache-hit != 'true'
with:
toolchain: "${{ steps.toolchain-config.outputs.toolchain }}"
targets: "${{ steps.toolchain-config.outputs.targets }}"
components: "${{ inputs.components || 'clippy, rustfmt' }}"
- name: Rust Dependency Cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref_name == 'develop' }}
shared-key: "rust-cache-${{ runner.os }}-${{ runner.arch }}-${{ runner.environment }}-${{ steps.toolchain-config.outputs.toolchain }}-${{ steps.toolchain-config.outputs.targets }}${{ inputs.cache-suffix && format('-{0}', inputs.cache-suffix) || '' }}"
- name: Rust Compile Cache
uses: mozilla-actions/sccache-action@v0.0.9
- name: Install Protoc (for lance-encoding build step)
if: runner.os != 'Windows'
uses: arduino/setup-protoc@v3
with:
version: "29.3"
repo-token: ${{ inputs.repo-token }}