File tree Expand file tree Collapse file tree 6 files changed +59
-3
lines changed Expand file tree Collapse file tree 6 files changed +59
-3
lines changed Original file line number Diff line number Diff line change 6
6
packages :
7
7
description : The json encoded package list
8
8
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 }}
9
12
jobs :
10
13
get-package-list :
11
14
name : Get packages list
@@ -31,11 +34,14 @@ jobs:
31
34
- name : Dump Package List
32
35
if : steps.cache-package-list.outputs.cache-hit != 'true'
33
36
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
35
38
- name : Get Package List
36
39
id : get_package_list
37
40
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
40
44
outputs :
41
45
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 }}
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change 25
25
needs :
26
26
- prebuild-ubuntu
27
27
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
28
32
bundle-size-tests :
29
33
needs : prebuild-ubuntu
30
34
uses : ./.github/workflows/callable-bundle-size-tests.yml
Original file line number Diff line number Diff line change 24
24
needs :
25
25
- prebuild
26
26
uses : ./.github/workflows/callable-unit-tests.yml
27
+ native-unit-tests :
28
+ needs :
29
+ - prebuild
30
+ uses : ./.github/workflows/callable-native-unit-tests.yml
27
31
bundle-size-tests :
28
32
needs : prebuild
29
33
uses : ./.github/workflows/callable-bundle-size-tests.yml
Original file line number Diff line number Diff line change 11
11
"access" : " public"
12
12
},
13
13
"scripts" : {
14
+ "prepare:ios" : " echo 'no-op'" ,
15
+ "prepare:android" : " echo 'no-op'" ,
14
16
"test" : " npm run lint && jest -w 1 --coverage --logHeapUsage" ,
17
+ "test:ios" : " echo 'no-op'" ,
15
18
"test:android" : " ./android/gradlew test -p ./android" ,
16
19
"build-with-test" : " npm run clean && npm test && tsc" ,
17
20
"build:esm-cjs" : " rollup --forceExit -c rollup.config.mjs" ,
Original file line number Diff line number Diff line change 11
11
"access" : " public"
12
12
},
13
13
"scripts" : {
14
+ "prepare:ios" : " echo 'no-op'" ,
15
+ "prepare:android" : " echo 'no-op'" ,
14
16
"test" : " echo 'no-op'" ,
17
+ "test:ios" : " echo 'no-op'" ,
15
18
"test:android" : " ./android/gradlew test -p ./android" ,
16
19
"build-with-test" : " npm run clean && npm test && tsc" ,
17
20
"build:esm-cjs" : " rollup --forceExit -c rollup.config.mjs" ,
You can’t perform that action at this time.
0 commit comments