1
0
mirror of https://github.com/getsops/sops.git synced 2026-02-05 12:45:21 +01:00

github actions: set rust version globally

Signed-off-by: Sebastien Duthil <duthils@duthils.net>
This commit is contained in:
Sebastien Duthil
2024-09-11 21:10:55 -04:00
parent 301e350285
commit ae2ac422fa
3 changed files with 22 additions and 6 deletions

View File

@@ -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 }}

View File

@@ -7,8 +7,9 @@ on:
pull_request:
branches:
- main
# Only run when linted files change
# Only run when Rust version or linted files change
paths:
- 'rust-toolchain.toml'
- 'functional-tests/**/*.rs'
permissions:
@@ -22,8 +23,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

3
rust-toolchain.toml Normal file
View File

@@ -0,0 +1,3 @@
[toolchain]
channel = "1.70.0"
profile = "minimal"