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
95 lines (83 loc) · 3.13 KB
/
action.yml
File metadata and controls
95 lines (83 loc) · 3.13 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
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)"
default: "clippy, rustfmt"
required: false
targets:
description: "optional targets override (e.g. wasm32-unknown-unknown)"
required: false
enable-sccache:
description: "Should sccache be enabled, true by default."
required: false
default: "true"
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
env:
TOOLCHAIN_OVERRIDE: ${{ inputs.toolchain }}
- name: Install Mold
if: runner.os == 'Linux'
uses: rui314/setup-mold@v1
- name: Check for rustup
id: check-rustup
shell: bash
run: echo "exists=$(command -v rustup &> /dev/null && echo 'true' || echo 'false')" >> $GITHUB_OUTPUT
- name: Rust Toolchain
id: rust-toolchain
uses: dtolnay/rust-toolchain@stable
if: steps.check-rustup.outputs.exists != 'true'
with:
toolchain: "${{ steps.toolchain-config.outputs.toolchain }}"
targets: "${{ inputs.targets }}"
components: "${{ inputs.components }}"
- name: Install additional targets and components
if: steps.check-rustup.outputs.exists == 'true'
shell: bash
run: |
rustup toolchain install "$TOOLCHAIN"
[[ -n "$TARGETS" ]] && rustup target add --toolchain "$TOOLCHAIN" ${TARGETS//,/ }
[[ -n "$COMPONENTS" ]] && rustup component add --toolchain "$TOOLCHAIN" ${COMPONENTS//,/ }
env:
TOOLCHAIN: ${{ steps.toolchain-config.outputs.toolchain }}
TARGETS: ${{ inputs.targets }}
COMPONENTS: ${{ inputs.components }}
- name: Configure sccache timeout
if: inputs.enable-sccache == 'true'
shell: bash
run: |
mkdir -p ~/.config/sccache
echo 'server_startup_timeout_ms = 60000' > ~/.config/sccache/config
- name: Rust Compile Cache
if: inputs.enable-sccache == 'true'
uses: mozilla-actions/sccache-action@v0.0.9
- name: Pre-start sccache server
if: inputs.enable-sccache == 'true'
shell: bash
run: sccache --start-server
- name: Install Protoc (for lance-encoding build step)
if: runner.os != 'Windows'
uses: ./.github/actions/setup-protoc
- name: Install Sweep
shell: bash
if: ${{ inputs.timestamp == 'true' && github.ref_name == 'develop' }}
run: cargo install cargo-sweep
- name: Timestamp Cache
shell: bash
if: ${{ inputs.timestamp == 'true' && github.ref_name == 'develop' }}
run: cargo sweep --stamp