Skip to content

Commit ac06885

Browse files
sobermjjarvisp
andauthored
feat(rtn-passkeys): add rtn passkeys (#14489)
* feat(rtn-passkeys): scaffold native package - 1 (#14390) feat: add rtn-passkeys package * feat(rtn-passkeys): modify existing implementation - 2 (#14391) * feat: add rtn-passkeys package * feat: modify existing implementation * chore: refactor exports --------- Co-authored-by: Michael Sober <[email protected]> * feat(rtn-passkeys): add ios support - 3a (#14392) * feat(rtn-passkeys): add android support - 3b (#14393) * feat(rtn-passkeys): add native unit tests in ci - 4 (#14399) * feat(rtn-passkeys): enable e2e - 5 (#14400) * chore: add missing license headers * chore: download iOS platform and create simulator --------- Co-authored-by: James Jarvis <[email protected]>
1 parent 3ea1c8e commit ac06885

File tree

138 files changed

+6959
-239
lines changed

Some content is hidden

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

138 files changed

+6959
-239
lines changed

.github/integ-config/detox-integ-all.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@
2020
working_directory: amplify-js-samples-staging/samples/react-native/auth/HosteduiApp
2121
timeout_minutes: 120
2222
host_signout_page: true
23+
- test_name: 'integ_rn_ios_passkeys'
24+
working_directory: amplify-js-samples-staging/samples/react-native/auth/Passkeys
25+
timeout_minutes: 120

.github/workflows/callable-e2e-test-detox.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ jobs:
3434
- name: Set Xcode version
3535
run: |
3636
sudo xcode-select -s /Applications/Xcode_16.4.app
37+
- name: Download iOS platform and create simulator
38+
if: ${{ contains(inputs.test_name, 'integ_rn_ios_passkeys') }}
39+
run: |
40+
xcodebuild -downloadPlatform iOS -buildVersion 17.4
41+
xcrun simctl create "iPhone 15" "com.apple.CoreSimulator.SimDeviceType.iPhone-15" "com.apple.CoreSimulator.SimRuntime.iOS-17-4"
3742
- name: Setup samples staging repository
3843
uses: ./amplify-js/.github/actions/setup-samples-staging
3944
with:

.github/workflows/callable-get-package-list.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
packages:
77
description: The json encoded package list
88
value: ${{ jobs.get-package-list.outputs.packages }}
9+
nativePackages:
10+
description: The json encoded native package list
11+
value: ${{ jobs.get-package-list.outputs.nativePackages }}
912
jobs:
1013
get-package-list:
1114
name: Get packages list
@@ -31,11 +34,14 @@ jobs:
3134
- name: Dump Package List
3235
if: steps.cache-package-list.outputs.cache-hit != 'true'
3336
run: |
34-
echo "packages=$(yarn lerna ll | egrep -v "lerna|Done|yarn" | jq -R -s -c 'split("\n")[:-1] | map({name: split(" ")[0], path: split(" ")[-1]})')" > package-list.json
37+
yarn lerna ll | egrep -v "lerna|Done|yarn" | jq -R -s -c 'split("\n")[:-1] | map({name: split(" ")[0], path: split(" ")[-1]})' > package-list.json
3538
- name: Get Package List
3639
id: get_package_list
3740
run: |
38-
cat package-list.json >> $GITHUB_OUTPUT
39-
cat package-list.json
41+
echo "packages=$(cat package-list.json)" >> $GITHUB_OUTPUT
42+
# temporarily filter to only packages with runnable tests
43+
echo "nativePackages=$(jq -c 'map(select(.name | test("rtn-passkeys|react-native")))' package-list.json)" >> $GITHUB_OUTPUT
4044
outputs:
4145
packages: ${{ steps.get_package_list.outputs.packages }}
46+
# todo: expand native package list as other tests are made runnable
47+
nativePackages: ${{ steps.get_package_list.outputs.nativePackages }}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Native Unit Tests
2+
3+
on: workflow_call
4+
5+
jobs:
6+
get-package-list:
7+
uses: ./.github/workflows/callable-get-package-list.yml
8+
unit_test:
9+
name: Native Unit Test - ${{ matrix.package.name }}
10+
runs-on: macos-latest
11+
needs: get-package-list
12+
strategy:
13+
matrix:
14+
package: ${{ fromJSON(needs.get-package-list.outputs.nativePackages) }}
15+
fail-fast: false
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
19+
with:
20+
path: amplify-js
21+
- name: Setup node and build the repository
22+
uses: ./amplify-js/.github/actions/node-and-build
23+
- name: Run iOS Tests
24+
working-directory: ./amplify-js
25+
env:
26+
TEST_PACKAGE: ${{ matrix.package.name }}
27+
run: |
28+
npx lerna exec --scope $TEST_PACKAGE yarn prepare:ios
29+
npx lerna exec --scope $TEST_PACKAGE yarn test:ios
30+
- name: Run Android Tests
31+
working-directory: ./amplify-js
32+
env:
33+
TEST_PACKAGE: ${{ matrix.package.name }}
34+
run: |
35+
npx lerna exec --scope $TEST_PACKAGE yarn prepare:android
36+
npx lerna exec --scope $TEST_PACKAGE yarn test:android

.github/workflows/callable-release-verification.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ jobs:
2525
needs:
2626
- prebuild-ubuntu
2727
uses: ./.github/workflows/callable-unit-tests.yml
28+
native-unit-tests:
29+
needs:
30+
- prebuild-macos
31+
uses: ./.github/workflows/callable-native-unit-tests.yml
2832
bundle-size-tests:
2933
needs: prebuild-ubuntu
3034
uses: ./.github/workflows/callable-bundle-size-tests.yml

.github/workflows/pr.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ jobs:
2424
needs:
2525
- prebuild
2626
uses: ./.github/workflows/callable-unit-tests.yml
27+
native-unit-tests:
28+
needs:
29+
- prebuild
30+
uses: ./.github/workflows/callable-native-unit-tests.yml
2731
bundle-size-tests:
2832
needs: prebuild
2933
uses: ./.github/workflows/callable-bundle-size-tests.yml

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ xcuserdata/
5050
!*.xcworkspace/contents.xcworkspacedata
5151
/*.gcno
5252
**/xcshareddata/WorkspaceSettings.xcsettings
53-
**/.xcode.env.local
53+
*.xcode.env.local
5454

5555
### Coverage ###
5656
coverage/
@@ -65,7 +65,12 @@ coverage-ts/
6565
**/example/ios/Podfile.lock
6666
**/example/.bundle
6767
**/example/yarn.lock
68+
**/example/amplify_outputs.json
6869

6970
# rollup
7071
**/.rollup.cache
7172
**/buildMeta
73+
74+
# ruby
75+
vendor/
76+
Gemfile.lock

eslint.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ export default [
301301
'**/__tests__/**',
302302
'**/packages/adapter-nextjs/**',
303303
'**/packages/react-native/example/**',
304+
'**/packages/rtn-passkeys/example/**',
304305
],
305306
rules: {
306307
'import/no-extraneous-dependencies': 'error',

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@
5858
"packages/rtn-web-browser",
5959
"packages/react-native",
6060
"packages/react-native/example",
61+
"packages/rtn-passkeys",
62+
"packages/rtn-passkeys/example",
6163
"scripts/tsc-compliance-test"
6264
],
6365
"nohoist": [

packages/api-graphql/__tests__/AWSAppSyncEventProvider.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
14
import { Observable, Observer } from 'rxjs';
25
import { Reachability } from '@aws-amplify/core/internals/utils';
36
import { ConsoleLogger } from '@aws-amplify/core';

0 commit comments

Comments
 (0)