Skip to content

Commit 0c0e632

Browse files
committed
Upd Crates, Rust, MSRV, GHA and remove Backtrace
- Changed MSRV to v1.65. Discussed this with @dani-garcia, and we will support **N-2**. This is/will be the same as for the `time` crate we use. Also updated the wiki regarding this https://github.com/dani-garcia/vaultwarden/wiki/Building-binary - Removed backtrace crate in favor of `std::backtrace` stable since v1.65 - Updated Rust to v1.67.1 - Updated all the crates - Updated the GHA action versions - Adjusted the GHA MSRV build to extract the MSRV from `Cargo.toml`
1 parent a13a5bd commit 0c0e632

27 files changed

+200
-231
lines changed

.github/workflows/build.yml

+23-13
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99
- "Cargo.*"
1010
- "build.rs"
1111
- "rust-toolchain"
12+
- "rustfmt.toml"
13+
- "diesel.toml"
1214
pull_request:
1315
paths:
1416
- ".github/workflows/build.yml"
@@ -17,6 +19,8 @@ on:
1719
- "Cargo.*"
1820
- "build.rs"
1921
- "rust-toolchain"
22+
- "rustfmt.toml"
23+
- "diesel.toml"
2024

2125
jobs:
2226
build:
@@ -26,60 +30,66 @@ jobs:
2630
# This is done globally to prevent rebuilds when the RUSTFLAGS env variable changes.
2731
env:
2832
RUSTFLAGS: "-D warnings"
33+
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: git # Use the old git protocol until it is stable probably in 1.68 or 1.69. MSRV needs to be at this before removed.
2934
strategy:
3035
fail-fast: false
3136
matrix:
3237
channel:
3338
- "rust-toolchain" # The version defined in rust-toolchain
3439
- "msrv" # The supported MSRV
35-
include:
36-
- channel: "msrv"
37-
version: "1.61.0"
3840

3941
name: Build and Test ${{ matrix.channel }}
4042

4143
steps:
4244
# Checkout the repo
4345
- name: "Checkout"
44-
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
46+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
4547
# End Checkout the repo
4648

49+
4750
# Install dependencies
4851
- name: "Install dependencies Ubuntu"
4952
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends openssl sqlite build-essential libmariadb-dev-compat libpq-dev libssl-dev pkg-config
5053
# End Install dependencies
5154

55+
5256
# Determine rust-toolchain version
5357
- name: Init Variables
5458
id: toolchain
5559
shell: bash
56-
if: ${{ matrix.channel == 'rust-toolchain' }}
5760
run: |
58-
RUST_TOOLCHAIN="$(cat rust-toolchain)"
61+
if [[ "${{ matrix.channel }}" == 'rust-toolchain' ]]; then
62+
RUST_TOOLCHAIN="$(cat rust-toolchain)"
63+
elif [[ "${{ matrix.channel }}" == 'msrv' ]]; then
64+
RUST_TOOLCHAIN="$(grep -oP 'rust-version.*"(\K.*?)(?=")' Cargo.toml)"
65+
else
66+
RUST_TOOLCHAIN="${{ matrix.channel }}"
67+
fi
5968
echo "RUST_TOOLCHAIN=${RUST_TOOLCHAIN}" | tee -a "${GITHUB_OUTPUT}"
6069
# End Determine rust-toolchain version
6170

62-
# Uses the rust-toolchain file to determine version
71+
72+
# Only install the clippy and rustfmt components on the default rust-toolchain
6373
- name: "Install rust-toolchain version"
64-
uses: dtolnay/rust-toolchain@55c7845fad90d0ae8b2e83715cb900e5e861e8cb # master @ 2022-10-25 - 21:40 GMT+2
74+
uses: dtolnay/rust-toolchain@e12eda571dc9a5ee5d58eecf4738ec291c66f295 # master @ 2023-02-19 - 02:23 GMT+1
6575
if: ${{ matrix.channel == 'rust-toolchain' }}
6676
with:
6777
toolchain: "${{steps.toolchain.outputs.RUST_TOOLCHAIN}}"
6878
components: clippy, rustfmt
6979
# End Uses the rust-toolchain file to determine version
7080

7181

72-
# Install the MSRV channel to be used
82+
# Install the any other channel to be used for which we do not execute clippy and rustfmt
7383
- name: "Install MSRV version"
74-
uses: dtolnay/rust-toolchain@55c7845fad90d0ae8b2e83715cb900e5e861e8cb # master @ 2022-10-25 - 21:40 GMT+2
84+
uses: dtolnay/rust-toolchain@e12eda571dc9a5ee5d58eecf4738ec291c66f295 # master @ 2023-02-19 - 02:23 GMT+1
7585
if: ${{ matrix.channel != 'rust-toolchain' }}
7686
with:
77-
toolchain: ${{ matrix.version }}
87+
toolchain: "${{steps.toolchain.outputs.RUST_TOOLCHAIN}}"
7888
# End Install the MSRV channel to be used
7989

8090

8191
# Enable Rust Caching
82-
- uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # v2.2.0
92+
- uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f # v2.2.1
8393
# End Enable Rust Caching
8494

8595

@@ -184,7 +194,7 @@ jobs:
184194

185195
# Upload artifact to Github Actions
186196
- name: "Upload artifact"
187-
uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # v3.1.1
197+
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
188198
if: ${{ matrix.channel == 'rust-toolchain' }}
189199
with:
190200
name: vaultwarden

.github/workflows/hadolint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
steps:
1414
# Checkout the repo
1515
- name: Checkout
16-
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
16+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
1717
# End Checkout the repo
1818

1919

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
steps:
6565
# Checkout the repo
6666
- name: Checkout
67-
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
67+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
6868
with:
6969
fetch-depth: 0
7070

0 commit comments

Comments
 (0)