Skip to content
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

E2E CI configuration #217

Merged
merged 60 commits into from
May 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
f2ac403
chore: clean up, save screenshots, update podfile.lock
May 11, 2021
5bb7cab
chore: CI ios debug
May 11, 2021
3692e13
chore: CI ios debug
May 11, 2021
536abdf
chore: .env.ci
May 11, 2021
971b6e7
chore: clean up
May 11, 2021
0bb8695
chore: config
May 11, 2021
6507e17
fix: test
May 11, 2021
9ef7984
fix: test
May 11, 2021
ce60b60
fix: tests
May 11, 2021
2c3566e
fix: tests
May 11, 2021
c4978fa
fix: tests
May 11, 2021
2051617
fix: tests
May 11, 2021
d8303df
fix: tests
May 11, 2021
1e164c1
chore: config
May 12, 2021
8539a5a
chore: platformVersion
May 12, 2021
661917d
chore: re-run tests
May 12, 2021
210899f
chore: re-run tests
May 12, 2021
16218b6
chore: test improvements
May 12, 2021
d54c9c5
chore: test improvements
May 12, 2021
30eeb8b
chore: update yarn.lock
May 12, 2021
f439320
chore: increase timeout
May 12, 2021
a82ffbb
chore: clean up
May 12, 2021
922cfe3
chore: update docs, refactor CI config
May 12, 2021
d9421c2
chore: clean up
May 12, 2021
08b3360
chore: clean up
May 12, 2021
0edd93f
chore: android resolution
May 12, 2021
63b7f4d
chore: clean up
May 12, 2021
a57d3b7
chore: re-run tests
May 13, 2021
19b4be2
fix: test
May 13, 2021
890af64
chore: ios version
May 13, 2021
31dd51b
chore: remove screen shots
May 13, 2021
4ac3946
chore: clean up
May 13, 2021
ec21e9c
chore: linux for andoird tests
May 13, 2021
3093773
chore: linux for andoird tests
May 13, 2021
99ed957
chore: use android runner action
May 13, 2021
f1f838d
chore: clean up
May 13, 2021
b939f5d
chore: clean up
May 13, 2021
ed7e10e
chore: clean up
May 13, 2021
387e511
chore: improvements
May 13, 2021
851fb63
chore: improvements
May 13, 2021
103da08
chore: improvements
May 13, 2021
3d34f29
chore: improvements
May 13, 2021
c5dc8e7
chore: rerun tests
May 13, 2021
8c8fd1c
chore: improvements
May 13, 2021
cc695cd
chore: improvements
May 13, 2021
e91930b
chore: improvements
May 13, 2021
99f0df0
chore: improvements
May 13, 2021
9d4d25c
chore: improvements
May 13, 2021
d8cbc2d
chore: improvements
May 13, 2021
bf2fe07
chore: test config
May 13, 2021
5d1499a
chore: tests retries
May 13, 2021
075bf34
chore: ss
May 13, 2021
313b3a5
chore: fix test
May 13, 2021
d6c08aa
chore: kill uiautomator process
May 14, 2021
5f6f5b9
chore: run appium-doctor
May 14, 2021
46afc54
fix: config
May 14, 2021
fb61e5e
chore: clean up
May 14, 2021
cd7b748
chore: re-run tests
May 14, 2021
1a00349
chore: afterpay clearpay
May 14, 2021
00aeb66
chore: workflows clean up
May 14, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 0 additions & 98 deletions .circleci/config.yml

This file was deleted.

65 changes: 37 additions & 28 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: RN Stripe

on: push
on:
push:
branches: [master]
pull_request:
branches: ['**']

jobs:
test-android:
Expand All @@ -9,107 +13,112 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v2

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Setup Node.js environment
uses: actions/setup-node@v2.1.5
with:
node-version: 14.4.0

- name: Install React Native CLI
run: |
npm install react-native-cli
run: npm install react-native-cli

- name: Install Dependencies
run: |
yarn bootstrap
- name: Run Android Emulator
run: |
echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --install 'system-images;android-29;google_apis;x86_64'
echo "no" | $ANDROID_HOME/tools/bin/avdmanager create avd -n test_device -k 'system-images;android-29;google_apis;x86_64' --force
echo $ANDROID_HOME/emulator/emulator -list-avds
echo "Starting emulator"
nohup $ANDROID_HOME/emulator/emulator -avd test_device -no-snapshot > /dev/null 2>&1 &
$ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d '\r') ]]; do sleep 1; done; input keyevent 82'
$ANDROID_HOME/platform-tools/adb devices
echo "Emulator started"
- name: Build Android App
run: |
yarn run-example-android
sleep 15
- name: Run Tests
run: |
node ./run-appium-tests.js android

- name: Run Android Emulator and app
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
script: |
yarn run-example-android
sleep 15
node ./run-appium-tests.js android
- name: Upload Screenshoots
uses: actions/upload-artifact@v1
with:
name: e2e-results
path: .tmp
if: ${{ failure() }}
if: ${{ always() }}

- uses: actions/download-artifact@v2
with:
name: e2e-results
path: .tmp
if: ${{ failure() }}
if: ${{ always() }}

test-ios:
name: e2e-ios-test
runs-on: macOS-latest
env:
API_URL: https://rigorous-heartbreaking-cephalopod.glitch.me
steps:
- name: checkout
uses: actions/checkout@v2

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- uses: actions/cache@v1

- uses: actions/cache@v2
with:
path: example/ios/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-

- name: Setup Node.js environment
uses: actions/setup-node@v2.1.5
with:
node-version: 14.4.0

- name: Install React Native CLI
run: |
npm install react-native-cli
- name: Install Repo and Dependencies

- name: Install Dependencies
run: |
yarn bootstrap

- name: Build iOS App
run: |
yarn run-example-ios
BUILT_APP=`find ~/Library/Developer/Xcode/DerivedData -name StripeSdkExample.app | grep Build/Products/Release-iphonesimulator/StripeSdkExample.app`
mkdir -p example/ios/DerivedData/StripeSdkExample/Build/Products/Release-iphonesimulator
cp -R $BUILT_APP example/ios/DerivedData/StripeSdkExample/Build/Products/Release-iphonesimulator
sleep 30

- name: Run Tests
run: |
node ./run-appium-tests.js ios

- name: Upload Screenshoots
uses: actions/upload-artifact@v1
with:
name: e2e-results
path: .tmp
if: ${{ failure() }}
if: ${{ always() }}

- uses: actions/download-artifact@v2
with:
name: e2e-results
path: .tmp
if: ${{ failure() }}
if: ${{ always() }}
84 changes: 0 additions & 84 deletions .github/workflows/tests-and-build.yml

This file was deleted.

3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ Our pre-commit hooks verify that the linter and tests pass when committing.
### Tests

We use [Appium](https://github.com/appium/appium) for e2e testing.
Since we don't have configured CI yet we must remember to run tests locally for both platforms before merge pr's.
To to that you have to install and configure appium following its [documentation](https://github.com/appium/appium/blob/master/docs/en/about-appium/getting-started.md).
In order to run tests locally you have to install and configure appium following its [documentation](https://github.com/appium/appium/blob/master/docs/en/about-appium/getting-started.md).

Next, you have to specify emulator/simulator details in the config files.
To set it up on android, let's open `wdio.android.js/wdio.ios.js` files and edit `capabilities` section accordingly (platformVersion, deviceName, app).
Expand Down
Loading