|
1 | 1 | name: Setup Environment |
2 | 2 |
|
3 | | -on: |
4 | | - workflow_dispatch: |
5 | | - inputs: |
6 | | - rustfmt: |
7 | | - description: "Install Rustfmt" |
8 | | - required: false |
9 | | - default: "false" |
10 | | - clippy: |
11 | | - description: "Install Clippy" |
12 | | - required: false |
13 | | - default: "false" |
14 | | - solana: |
15 | | - description: "Install Solana" |
16 | | - required: false |
17 | | - default: "false" |
18 | | - TOOLCHAIN_FORMAT: |
19 | | - description: "Rust toolchain version for formatting" |
20 | | - required: false |
21 | | - default: "stable" |
22 | | - TOOLCHAIN_LINT: |
23 | | - description: "Rust toolchain version for linting" |
24 | | - required: false |
25 | | - default: "stable" |
26 | | - SOLANA_VERSION: |
27 | | - description: "Solana version to install" |
28 | | - required: false |
29 | | - default: "v1.8.0" |
| 3 | +on: workflow_dispatch |
30 | 4 |
|
31 | 5 | jobs: |
32 | 6 | setup: |
33 | 7 | runs-on: ubuntu-latest |
34 | 8 | steps: |
35 | | - - name: Git Checkout |
36 | | - uses: actions/checkout@v4 |
| 9 | + - uses: actions/checkout@v4 |
37 | 10 |
|
38 | | - - name: Install Rustfmt |
39 | | - if: ${{ github.event.inputs.rustfmt == 'true' }} |
| 11 | + - if: ${{ github.event.inputs.rustfmt == 'true' }} |
40 | 12 | uses: dtolnay/rust-toolchain@master |
41 | 13 | with: |
42 | 14 | toolchain: ${{ github.event.inputs.TOOLCHAIN_FORMAT }} |
43 | 15 | components: rustfmt |
44 | 16 |
|
45 | | - - name: Install Clippy |
46 | | - if: ${{ github.event.inputs.clippy == 'true' }} |
| 17 | + - if: ${{ github.event.inputs.clippy == 'true' }} |
47 | 18 | uses: dtolnay/rust-toolchain@master |
48 | 19 | with: |
49 | 20 | toolchain: ${{ github.event.inputs.TOOLCHAIN_LINT }} |
50 | 21 | components: clippy |
51 | 22 |
|
52 | | - - name: Install Solana |
53 | | - if: ${{ github.event.inputs.solana == 'true' }} |
| 23 | + - if: ${{ github.event.inputs.solana == 'true' }} |
54 | 24 | uses: solana-program/actions/install-solana@v1 |
55 | 25 | with: |
56 | 26 | version: ${{ github.event.inputs.SOLANA_VERSION }} |
57 | 27 | cache: true |
58 | | - |
59 | | - - name: Cache Cargo Dependencies |
60 | | - if: ${{ github.event.inputs.cargo_cache_key && !github.event.inputs.cargo_cache_fallback_key }} |
61 | | - uses: actions/cache@v4 |
62 | | - with: |
63 | | - path: | |
64 | | - ~/.cargo/bin/ |
65 | | - ~/.cargo/registry/index/ |
66 | | - ~/.cargo/registry/cache/ |
67 | | - ~/.cargo/git/db/ |
68 | | - target/ |
69 | | - key: ${{ runner.os }}-${{ github.event.inputs.cargo_cache_key }}-${{ hashFiles('**/Cargo.lock') }} |
70 | | - restore-keys: ${{ runner.os }}-${{ github.event.inputs.cargo_cache_key }} |
71 | | - |
72 | | - - name: Cache Cargo Dependencies With Fallback |
73 | | - if: ${{ github.event.inputs.cargo_cache_key && github.event.inputs.cargo_cache_fallback_key }} |
74 | | - uses: actions/cache@v4 |
75 | | - with: |
76 | | - path: | |
77 | | - ~/.cargo/bin/ |
78 | | - ~/.cargo/registry/index/ |
79 | | - ~/.cargo/registry/cache/ |
80 | | - ~/.cargo/git/db/ |
81 | | - target/ |
82 | | - key: ${{ runner.os }}-${{ github.event.inputs.cargo_cache_key }}-${{ hashFiles('**/Cargo.lock') }} |
83 | | - restore-keys: | |
84 | | - ${{ runner.os }}-${{ github.event.inputs.cargo_cache_key }} |
85 | | - ${{ runner.os }}-${{ github.event.inputs.cargo_cache_fallback_key }}-${{ hashFiles('**/Cargo.lock') }} |
86 | | - ${{ runner.os }}-${{ github.event.inputs.cargo_cache_fallback_key }} |
87 | | -
|
88 | | - - name: Cache Local Cargo Dependencies |
89 | | - if: ${{ github.event.inputs.cargo_cache_local_key }} |
90 | | - uses: actions/cache@v4 |
91 | | - with: |
92 | | - path: | |
93 | | - .cargo/bin/ |
94 | | - .cargo/registry/index/ |
95 | | - .cargo/registry/cache/ |
96 | | - .cargo/git/db/ |
97 | | - key: ${{ runner.os }}-${{ github.event.inputs.cargo_cache_local_key }}-${{ hashFiles('**/Cargo.lock') }} |
98 | | - restore-keys: ${{ runner.os }}-${{ github.event.inputs.cargo_cache_local_key }} |
0 commit comments