Skip to content

Commit

Permalink
github actions: set rust version globally
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastien Duthil <duthils@duthils.net>
  • Loading branch information
duthils committed Sep 13, 2024
1 parent 301e350 commit 48eeaf9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,18 @@ jobs:
VAULT_TOKEN: "root"
VAULT_ADDR: "http://127.0.0.1:8200"
steps:
- name: Install rustup
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y --default-toolchain 1.70.0

- name: Check out code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

# Rustup will detect toolchain version and profile from rust-toolchain.toml
# It will download and install the toolchain and components automatically
# and make them available for subsequent commands
- name: Install Rust toolchain
run: rustup show

- name: Show Rust version
run: cargo --version

- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: sops-linux-amd64-${{ github.sha }}
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,14 @@ jobs:
- name: Check out code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Install rustup
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y --default-toolchain 1.70.0
# Rustup will detect toolchain version and profile from rust-toolchain.toml
# It will download and install the toolchain and components automatically
# and make them available for subsequent commands
- name: Install Rust toolchain and additional components
run: rustup component add rustfmt

- name: Show Rust version
run: cargo --version

- name: Run Formatting Check
run: cargo fmt --check
Expand Down
3 changes: 3 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[toolchain]
channel = "1.70.0"
profile = "minimal"

0 comments on commit 48eeaf9

Please # to comment.