Skip to content

Commit d46814e

Browse files
authored
Merge branch 'main' into SRE-2330-deprecate-usage-of-auth-email-in-sdk-internal
2 parents efa9ca6 + 7269f31 commit d46814e

File tree

68 files changed

+1231
-637
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1231
-637
lines changed

.cargo/config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ rustflags = ["--cfg", "aes_armv8"]
66

77
[target.wasm32-unknown-unknown]
88
rustflags = ['--cfg', 'getrandom_backend="wasm_js"']
9+
runner = 'wasm-bindgen-test-runner'
910

1011
# Enable support for 16k pages on Android, JNA is using these same flags
1112
# https://android-developers.googleblog.com/2024/08/adding-16-kb-page-size-to-android.html

.github/workflows/build-wasm-internal.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ jobs:
2525

2626
- name: Set version (PR)
2727
if: ${{ github.event_name == 'pull_request' }}
28+
env:
29+
PR_HEAD_REF: "${{ github.event.pull_request.head.ref }}"
2830
run: |
29-
echo REF_NAME="${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV
31+
echo REF_NAME="$PR_HEAD_REF" >> $GITHUB_ENV
3032
echo SHA="${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
3133
3234
- name: Set env variables (Branch/Tag)
@@ -58,6 +60,10 @@ jobs:
5860
RUST_TOOLCHAIN="$(grep -oP '^channel.*"(\K.*?)(?=")' ../../rust-toolchain.toml)"
5961
echo "RUST_TOOLCHAIN=${RUST_TOOLCHAIN}" | tee -a "${GITHUB_OUTPUT}"
6062
63+
- name: NPM setup
64+
run: npm ci
65+
working-directory: crates/bitwarden-wasm-internal/npm
66+
6167
- name: Install rust
6268
uses: dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0 # stable
6369
with:

.github/workflows/publish-wasm-internal.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,16 @@ jobs:
4242
4343
- name: Version output
4444
id: version-output
45+
env:
46+
BRANCH: "${{ github.head_ref || github.ref_name }}"
4547
run: |
4648
if [ -z ${{ inputs.version }} ]; then
47-
BRANCH=${{ github.head_ref || github.ref_name }}
4849
VERSION=0.2.0-${BRANCH/\//-}.${{ github.run_number }}
4950
echo "version=$VERSION" >> $GITHUB_OUTPUT
51+
echo "### NPM Version: $VERSION" >> $GITHUB_STEP_SUMMARY
5052
else
5153
echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT
54+
echo "### NPM Version: ${{ inputs.version }}" >> $GITHUB_STEP_SUMMARY
5255
fi
5356
5457
npm:

.github/workflows/rust-test.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,37 @@ jobs:
4545
- name: Test
4646
run: cargo test --workspace --all-features
4747

48+
test-wasm:
49+
name: WASM
50+
runs-on: ubuntu-24.04
51+
52+
steps:
53+
- name: Checkout
54+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
55+
56+
- name: Set Rust Toolchain
57+
id: toolchain
58+
shell: bash
59+
run: |
60+
RUST_TOOLCHAIN="$(grep -oP '^channel.*"(\K.*?)(?=")' rust-toolchain.toml)"
61+
echo "RUST_TOOLCHAIN=${RUST_TOOLCHAIN}" | tee -a "${GITHUB_OUTPUT}"
62+
63+
- name: Install rust
64+
uses: dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0 # stable
65+
with:
66+
toolchain: "${{ steps.toolchain.outputs.RUST_TOOLCHAIN }}"
67+
targets: wasm32-unknown-unknown
68+
components: rust-src
69+
70+
- name: Cache cargo registry
71+
uses: Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
72+
73+
- name: Install wasm-bindgen-cli
74+
run: cargo install wasm-bindgen-cli --version 0.2.100
75+
76+
- name: Test WASM
77+
run: cargo test --target wasm32-unknown-unknown -p bitwarden-wasm-internal -p bitwarden-threading -p bitwarden-error --all-features
78+
4879
coverage:
4980
name: Coverage
5081
runs-on: ubuntu-24.04

0 commit comments

Comments
 (0)