-
Notifications
You must be signed in to change notification settings - Fork 4.7k
[RNMobile][Monorepo] Use github actions to run React Native e2e tests #22189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
hypest
merged 23 commits into
feat/import-gutenberg-mobile-no-squash
from
try/github-actions-ios-ci
May 15, 2020
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
73bc4c9
Try travis config for RN e2e tests
Tug 549f949
fix
Tug 6bd718c
Create bundle folder for iOS before bundling for e2e
ceyhun c3e8ea1
Trigger CI
ceyhun e8b3c1e
Fix wrong simulator pick on Travis for e2e tests
ceyhun 9d10c53
Change iOS simulator version used for e2e test to 13.3
ceyhun 94a1e41
Try GitHub actions
ceyhun da06141
Increase timeout
ceyhun ffa949c
Decrease recording resolution
ceyhun 905fdf5
Add names to react native action workflows
ceyhun a092f92
Rename react native action workflows
ceyhun 7fb121e
Prevent accidental touches to home button on iOS while scrolling
ceyhun e6a3536
Merge branch 'feat/import-gutenberg-mobile-no-squash' into try/github…
ceyhun 08c90a9
Add gradle cache
ceyhun eef9ede
Run only subset of tests and in parallel
ceyhun f130da3
Merge remote-tracking branch 'origin/feat/import-gutenberg-mobile-no-…
Tug 1313dd0
Revert any changes to package-lock.json
Tug 160e9a4
Use v1 for actions/cache
ceyhun 392d479
Update native e2e tests from gutenberg-mobile/develop
ceyhun d4c8b64
bundle js before running ios e2e tests
Tug a796690
Exclude e2e tests generated files from git
Tug 6c417eb
Move js bundle to test:e2e:ios:local instead
Tug c67d974
set implicit wait timeout on driver setup instead of EditorPage const…
Tug File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| name: React Native E2E Tests (Android) | ||
| on: push | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: macos-latest | ||
| strategy: | ||
| matrix: | ||
| native-test-name: [ | ||
| gutenberg-editor-heading, | ||
| gutenberg-editor-image, | ||
| ] | ||
|
|
||
| steps: | ||
| - name: checkout | ||
| uses: actions/checkout@v2 | ||
|
|
||
| - name: Restore npm cache | ||
| uses: actions/cache@v1 | ||
| with: | ||
| path: ~/.npm | ||
| key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-npm- | ||
|
|
||
| - run: npm ci | ||
|
|
||
| - name: Restore Gradle cache | ||
| uses: actions/cache@v1 | ||
| with: | ||
| path: ~/.gradle/caches | ||
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | ||
| restore-keys: ${{ runner.os }}-gradle | ||
|
|
||
| - uses: reactivecircus/android-emulator-runner@v2 | ||
| with: | ||
| api-level: 28 | ||
| profile: pixel_xl | ||
| script: npm run native test:e2e:android:local ${{ matrix.native-test-name }} | ||
|
|
||
| - uses: actions/upload-artifact@v2 | ||
| if: always() | ||
| with: | ||
| name: android-screen-recordings | ||
| path: packages/react-native-editor/android-screen-recordings | ||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| name: React Native E2E Tests (iOS) | ||
| on: push | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: macos-latest | ||
| strategy: | ||
| matrix: | ||
| native-test-name: [ | ||
| gutenberg-editor-heading, | ||
| gutenberg-editor-image, | ||
| ] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v2 | ||
|
|
||
| - name: Restore npm cache | ||
| uses: actions/cache@v1 | ||
| with: | ||
| path: ~/.npm | ||
| key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-npm- | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| source ~/.nvm/nvm.sh | ||
| nvm install | ||
| npm ci | ||
|
|
||
| - name: Prepare build cache key | ||
| run: find package-lock.json packages/react-native-editor/ios packages/react-native-aztec/ios packages/react-native-bridge/ios -type f -print0 | sort -z | xargs -0 shasum | tee ios-checksums.txt | ||
|
|
||
| - name: Restore build cache | ||
| uses: actions/cache@v1 | ||
| with: | ||
| path: packages/react-native-editor/ios/build/gutenberg/Build/Products/Release-iphonesimulator/GutenbergDemo.app | ||
| key: ${{ runner.os }}-ios-build-${{ hashFiles('ios-checksums.txt') }} | ||
|
|
||
| - name: Restore pods cache | ||
| uses: actions/cache@v1 | ||
| with: | ||
| path: | | ||
| packages/react-native-editor/ios/Pods | ||
| ~/Library/Caches/CocoaPods | ||
| ~/.cocoapods/repos/trunk | ||
| packages/react-native-editor/ios/vendor | ||
| key: ${{ runner.os }}-pods-${{ hashFiles('packages/react-native-editor/ios/Gemfile.lock') }}-${{ hashFiles('packages/react-native-editor/ios/Podfile.lock') }}-${{ hashFiles('package-lock.json') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-pods-${{ hashFiles('packages/react-native-editor/ios/Gemfile.lock') }}-${{ hashFiles('packages/react-native-editor/ios/Podfile.lock') }}-${{ hashFiles('package-lock.json') }} | ||
| ${{ runner.os }}-pods-${{ hashFiles('packages/react-native-editor/ios/Gemfile.lock') }}-${{ hashFiles('packages/react-native-editor/ios/Podfile.lock') }}- | ||
| ${{ runner.os }}-pods-${{ hashFiles('packages/react-native-editor/ios/Gemfile.lock') }}- | ||
| ${{ runner.os }}-pods- | ||
|
|
||
| - name: Bundle iOS | ||
| run: npm run native test:e2e:bundle:ios | ||
|
|
||
| - name: Build (if needed) | ||
| run: test -e packages/react-native-editor/ios/build/gutenberg/Build/Products/Release-iphonesimulator/GutenbergDemo.app/GutenbergDemo || SKIP_BUNDLING=true npm run native test:e2e:build-app:ios | ||
|
|
||
| - name: Run iOS Device Tests | ||
| run: TEST_RN_PLATFORM=ios npm run native device-tests:local ${{ matrix.native-test-name }} | ||
|
|
||
| - name: Prepare build cache | ||
| run: rm packages/react-native-editor/ios/build/gutenberg/Build/Products/Release-iphonesimulator/GutenbergDemo.app/main.jsbundle | ||
|
|
||
| - uses: actions/upload-artifact@v2 | ||
| if: always() | ||
| with: | ||
| name: ios-screen-recordings | ||
| path: packages/react-native-editor/ios-screen-recordings |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain a bit how this works? Where are the artifacts stored? For how long? How can one access it when looking at a PR?
This could be a nice addition to the mobile doc, otherwise just a comment on this PR so people can find this information using git blame :)
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind, found them here at the top right of the check screen

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case it's useful, there is some more information here about GitHub actions artifacts: https://help.github.com/en/actions/configuring-and-managing-workflows/persisting-workflow-data-using-artifacts.
@ceyhun 👋 😄 nice work on this! I ❤️ seeing these workflows integrated with GitHub!