Skip to content

Commit d20ac4e

Browse files
authored
test: Add nightly repeated unit test (#2667)
1 parent fb3966f commit d20ac4e

File tree

2 files changed

+55
-1
lines changed

2 files changed

+55
-1
lines changed

.github/composite_actions/run_xcodebuild_test/action.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ inputs:
1212
required: false
1313
type: string
1414
default: 'platform=iOS Simulator,name=iPhone 13,OS=latest'
15+
sdk:
16+
required: false
17+
type: string
18+
default: 'iphonesimulator'
19+
other_flags:
20+
required: false
21+
type: string
22+
default: ''
1523

1624
runs:
1725
using: "composite"
@@ -22,5 +30,5 @@ runs:
2230
PROJECT_PATH: ${{ inputs.project_path }}
2331
run: |
2432
cd $PROJECT_PATH
25-
xcodebuild test -scheme $SCHEME -sdk iphonesimulator -destination '${{ inputs.destination }}' | xcpretty --simple --color --report junit && exit ${PIPESTATUS[0]}
33+
xcodebuild test -scheme $SCHEME -sdk '${{ inputs.sdk }}' -destination '${{ inputs.destination }}' ${{ inputs.other_flags }} | xcpretty --simple --color --report junit && exit ${PIPESTATUS[0]}
2634
shell: bash
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Amplify Nightly Repeated Unit Test
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: '30 1 * * *'
6+
7+
permissions:
8+
contents: read
9+
10+
concurrency:
11+
group: ${{ github.head_ref || github.run_id }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
unit_test_ios:
16+
runs-on: macos-12
17+
strategy:
18+
matrix:
19+
scheme: [Amplify, AWSPluginsCore, AWSPinpointAnalyticsPlugin, AWSAPIPlugin, AWSCognitoAuthPlugin, AWSDataStorePlugin, AWSLocationGeoPlugin, AWSS3StoragePlugin]
20+
steps:
21+
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
22+
23+
- name: Run repeated unit test iOS
24+
uses: ./.github/composite_actions/run_xcodebuild_test
25+
with:
26+
project_path: .
27+
scheme: ${{ matrix.scheme }}
28+
other_flags: -test-iterations 100 -run-tests-until-failure
29+
30+
unit_test_macos:
31+
runs-on: macos-12
32+
strategy:
33+
matrix:
34+
scheme: [Amplify, AWSPluginsCore, AWSPinpointAnalyticsPlugin, AWSAPIPlugin, AWSCognitoAuthPlugin, AWSDataStorePlugin, AWSLocationGeoPlugin, AWSS3StoragePlugin]
35+
steps:
36+
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
37+
38+
- name: Run repeated unit test macOS
39+
uses: ./.github/composite_actions/run_xcodebuild_test
40+
with:
41+
project_path: .
42+
scheme: ${{ matrix.scheme }}
43+
sdk: macosx
44+
destination: platform=macOS,arch=x86_64
45+
other_flags: -test-iterations 100 -run-tests-until-failure
46+

0 commit comments

Comments
 (0)