-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathaction.yml
42 lines (37 loc) · 1.34 KB
/
action.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
name: "Setup Rust"
description: "Toolchain setup and Initial compilation"
inputs:
targets:
description: "optional targets override (e.g. wasm32-unknown-unknown)"
required: false
runs:
using: "composite"
steps:
- name: Rust Version
id: rust-version
shell: bash
run: echo "version=$(cat rust-toolchain.toml | grep channel | awk -F'\"' '{print $2}')" >> $GITHUB_OUTPUT
- name: Rust Toolchain
id: rust-toolchain
uses: dtolnay/rust-toolchain@master
if: steps.rustup-cache.outputs.cache-hit != 'true'
with:
toolchain: "${{ steps.rust-version.outputs.version }}"
targets: "${{inputs.targets || ''}}"
components: clippy, rustfmt, miri, llvm-tools-preview
- name: Rust Dependency Cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref_name == 'develop' }}
shared-key: "rust-cache-${{ runner.os }}-${{ runner.environment }}" # To allow reuse across jobs
- name: Rust Compile Cache
uses: mozilla-actions/[email protected]
- name: Rust Compile Cache Config
shell: bash
run: |
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV
- name: Export Path
shell: bash
run: echo "PATH=$PATH" >> $GITHUB_ENV