[PM-28192] Migrate Cipher Attachment Operations to use SDK #7284
Workflow file for this run
This file contains hidden or 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" | |
| pull_request: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| permissions: | |
| contents: read | |
| jobs: | |
| ci-pass: | |
| name: Check if tests passed | |
| runs-on: ubuntu-24.04 | |
| needs: | |
| - test | |
| steps: | |
| - name: Check if tests passed | |
| run: exit 0 | |
| test: | |
| name: ${{ matrix.os }} / default | |
| runs-on: ${{ matrix.os || 'ubuntu-24.04' }} | |
| strategy: | |
| matrix: | |
| os: | |
| - ubuntu-24.04 | |
| - macOS-14 | |
| - windows-2022 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Free disk space | |
| uses: bitwarden/gh-actions/free-disk-space@main | |
| - name: Install rust | |
| uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable | |
| with: | |
| toolchain: stable | |
| - name: Cache cargo registry | |
| uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2 | |
| - name: Test | |
| run: cargo test --workspace --all-features | |
| test-wasm: | |
| name: WASM | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Set Rust Toolchain | |
| id: toolchain | |
| shell: bash | |
| run: | | |
| RUST_TOOLCHAIN="$(grep -oP '^channel.*"(\K.*?)(?=")' rust-toolchain.toml)" | |
| echo "RUST_TOOLCHAIN=${RUST_TOOLCHAIN}" | tee -a "${GITHUB_OUTPUT}" | |
| - name: Install rust | |
| uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable | |
| with: | |
| toolchain: "${{ steps.toolchain.outputs.RUST_TOOLCHAIN }}" | |
| targets: wasm32-unknown-unknown | |
| components: rust-src | |
| - name: Cache cargo registry | |
| uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2 | |
| - name: Test WASM | |
| run: cargo test --target wasm32-unknown-unknown -p bitwarden-wasm-internal -p bitwarden-threading -p bitwarden-error -p bitwarden-uuid --all-features | |
| - name: Test WASM (browser, bitwarden-state) | |
| run: | | |
| export CHROMEDRIVER=$(which chromedriver) | |
| cargo test --target wasm32-unknown-unknown -p bitwarden-state --features wasm,browser-tests | |
| coverage: | |
| name: Coverage | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Free disk space | |
| uses: bitwarden/gh-actions/free-disk-space@main | |
| - name: Install rust | |
| uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable | |
| with: | |
| toolchain: stable | |
| components: llvm-tools | |
| - name: Cache cargo registry | |
| uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2 | |
| - name: Install cargo-llvm-cov | |
| run: cargo install cargo-llvm-cov --version 0.5.38 --locked | |
| - 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@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0 |