forked from vercel/turbo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
73 lines (64 loc) · 2.53 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
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
name: "Turbo Rust Setup"
description: "Sets up the Rust toolchain for CI"
inputs:
target:
description: "Compilation target"
required: true
targets:
description: "Comma-separated list of target triples to install for this toolchain"
required: false
components:
description: "Comma-separated list of components to be additionally installed"
required: false
shared-cache-key:
description: "A cache key that is used instead of the automatic `job`-based key, and is stable over multiple jobs."
required: false
cache-key:
description: "An additional cache key that is added alongside the automatic `job`-based cache key and can be used to further differentiate jobs."
required: false
save-cache:
description: "Determiners whether the cache should be saved. If `false`, the cache is only restored."
required: false
default: "false"
runs:
using: "composite"
steps:
- name: "Get toolchain version from file"
id: file
shell: bash
run: echo "toolchain=$(cat ./rust-toolchain)" >> $GITHUB_OUTPUT
- name: "Set rust default environment"
shell: bash
run: |
echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV
echo "CARGO_TERM_COLOR=always" >> $GITHUB_ENV
echo "RUST_BACKTRACE=short" >> $GITHUB_ENV
# Enable faster sparse index on nightly
# https://internals.rust-lang.org/t/call-for-testing-cargo-sparse-registry/16862
echo "CARGO_UNSTABLE_SPARSE_REGISTRY=true" >> $GITHUB_ENV
- name: "Setup Rust toolchain"
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ steps.file.outputs.toolchain }}
targets: ${{ inputs.targets }}
components: ${{ inputs.components }}
- name: "Set Windows default host to MinGW"
if: ${{ inputs.target == 'windows' }}
shell: bash
run: rustup set default-host x86_64-pc-windows-gnu && rustup show
- name: "Add cargo problem matchers"
shell: bash
run: echo "::add-matcher::${{ github.action_path }}/matchers.json"
- name: "Setup Rust Cache"
uses: Swatinem/rust-cache@v2
with:
shared-key: ${{ inputs.shared-cache-key }}
key: ${{ inputs.cache-key }}
# the cache is huge and we only get 10gb max, so we only save on master
save-if: ${{ github.ref == 'refs/heads/main' && inputs.save-cache || 'false' }}
- name: "Install cargo-sweep"
uses: taiki-e/install-action@v2
with:
tool: cargo-sweep,cargo-groups
- name: "Run cargo-sweep"
uses: ./.github/actions/cargo-sweep