[PM-6107] Use rayon to multithread encryption/decryption #1275
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: Build @bitwarden/sdk-napi | |
on: | |
pull_request: | |
push: | |
branches: | |
- "master" | |
- "rc" | |
- "hotfix-rc" | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash | |
working-directory: crates/bitwarden-napi | |
jobs: | |
generate_schemas: | |
uses: ./.github/workflows/generate_schemas.yml | |
build: | |
name: Building @bitwarden/sdk-napi for - ${{ matrix.settings.os }} | |
runs-on: ${{ matrix.settings.os || 'ubuntu-latest' }} | |
needs: generate_schemas | |
strategy: | |
fail-fast: false | |
matrix: | |
settings: | |
- os: macos-12 | |
target: x86_64-apple-darwin | |
build: | | |
npm run build | |
strip -x *.node | |
- os: macos-12 | |
target: aarch64-apple-darwin | |
build: | | |
npm run build-arm64 | |
strip -x *.node | |
- os: windows-2022 | |
target: x86_64-pc-windows-msvc | |
build: npm run build | |
- os: ubuntu-22.04 | |
target: x86_64-unknown-linux-gnu | |
build: | | |
set -e && | |
npm run build && | |
strip *.node | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 | |
- name: Setup Node | |
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 | |
with: | |
node-version: 18 | |
cache: "npm" | |
cache-dependency-path: crates/bitwarden-napi/package-lock.json | |
- name: Install rust | |
uses: dtolnay/rust-toolchain@f361669954a8ecfc00a3443f35f9ac8e610ffc06 # stable | |
with: | |
toolchain: stable | |
targets: ${{ matrix.settings.target }} | |
- name: Cache cargo registry | |
uses: Swatinem/rust-cache@e207df5d269b42b69c8bc5101da26f7d31feddb4 # v2.6.2 | |
with: | |
key: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.os }} | |
- name: Retrieve schemas | |
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | |
with: | |
name: schemas.ts | |
path: ${{ github.workspace }}/crates/bitwarden-napi/src-ts/bitwarden_client/ | |
- name: Install dependencies | |
run: npm ci | |
- name: Build | |
run: ${{ matrix.settings.build }} | |
- name: Upload artifact | |
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 | |
with: | |
name: sdk-bitwarden-napi-${{ matrix.settings.target }} | |
path: ${{ github.workspace }}/crates/bitwarden-napi/sdk-napi.*.node | |
if-no-files-found: error |