Update MSRV to 1.71 and add CI test #3371
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust tests | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- "main" | |
- "rc" | |
- "hotfix-rc" | |
pull_request: | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
ci-pass: | |
name: CI is green | |
runs-on: ubuntu-22.04 | |
needs: | |
- test | |
- wasm | |
steps: | |
- run: exit 0 | |
test: | |
name: ${{ matrix.os }} / ${{matrix.target || 'default' }} | |
runs-on: ${{ matrix.os || 'ubuntu-22.04' }} | |
strategy: | |
matrix: | |
os: | |
- ubuntu-22.04 | |
- macOS-12 | |
- windows-2022 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Install rust | |
uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248 # stable | |
with: | |
toolchain: stable | |
- name: Cache cargo registry | |
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | |
- name: Test | |
run: cargo test --all-features | |
coverage: | |
name: Coverage | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Install rust | |
uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248 # stable | |
with: | |
toolchain: stable | |
components: llvm-tools | |
- name: Cache cargo registry | |
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | |
- name: Install cargo-llvm-cov | |
run: cargo install cargo-llvm-cov --version 0.5.38 | |
- name: Generate coverage | |
run: cargo llvm-cov --all-features --lcov --output-path lcov.info --ignore-filename-regex "crates/bitwarden-api-" | |
- name: Upload to codecov.io | |
uses: codecov/codecov-action@4fe8c5f003fae66aa5ebb77cfd3e7bfbbda0b6b0 # v3.1.5 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
msrv: | |
name: Check Rust minimum supported version | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Install rust | |
uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248 # stable | |
with: | |
# Important: When updating this, make sure to update the Readme file | |
# and also the `rust-version` field in all the `Cargo.toml`. | |
toolchain: 1.71.0 | |
- name: Cache cargo registry | |
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | |
- name: Test | |
run: cargo check --all-features | |
wasm: | |
name: WASM | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Install rust | |
uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248 # stable | |
with: | |
toolchain: stable | |
targets: wasm32-unknown-unknown | |
- name: Cache cargo registry | |
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | |
- name: Check | |
run: cargo check -p bitwarden-wasm --target wasm32-unknown-unknown | |
- name: Install wasm-pack | |
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | |
- name: Wasm-pack test firefox | |
run: wasm-pack test --headless --firefox crates/bitwarden-wasm | |
- name: Wasm-pack test chrome | |
run: wasm-pack test --headless --chrome crates/bitwarden-wasm |