-
Notifications
You must be signed in to change notification settings - Fork 36
68 lines (68 loc) · 2.84 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: react-native-square-reader-SDK
on: [push]
jobs:
install-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.x
- run: |
yarn && yarn lint && yarn test &&
cd reader-sdk-react-native-quickstart && yarn
yarn lint && cd ..
build-android:
runs-on: ubuntu-latest
steps:
- name: Cache Gradle Wrapper
uses: actions/cache@v3
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: Cache Gradle Dependencies
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-caches-
- name: Checkout the current repo
uses: actions/checkout@v3
- name: Install npm dependencies
working-directory: ./reader-sdk-react-native-quickstart
run: yarn
- name: Build
working-directory: ./reader-sdk-react-native-quickstart/android
env:
SQUARE_READER_SDK_APPLICATION_ID: ${{secrets.SQUARE_READER_SDK_APPLICATION_ID}}
SQUARE_READER_SDK_REPOSITORY_PASSWORD: ${{secrets.SQUARE_READER_SDK_REPOSITORY_PASSWORD}}
run: |
./gradlew clean build -PSQUARE_READER_SDK_APPLICATION_ID=$SQUARE_READER_SDK_APPLICATION_ID -PSQUARE_READER_SDK_REPOSITORY_PASSWORD=$SQUARE_READER_SDK_REPOSITORY_PASSWORD -x lint -x lintVitalRelease
build-ios:
runs-on: macos-latest
steps:
- uses: maxim-lobanov/setup-xcode@v1.5.1
with:
xcode-version: latest-stable
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
- uses: actions/checkout@v3
- name: Install Dependencies
working-directory: ./reader-sdk-react-native-quickstart
run: yarn
- name: Install Pod Dependencies
working-directory: ./reader-sdk-react-native-quickstart/ios
run: pod install
- name: Install Reader SDK
working-directory: ./reader-sdk-react-native-quickstart/ios
run: ruby <(curl https://connect.squareup.com/readersdk-installer) install --app-id ${{secrets.SQUARE_READER_SDK_APPLICATION_ID}} --repo-password ${{secrets.SQUARE_READER_SDK_REPOSITORY_PASSWORD}} --version 1.6.1 > /dev/null
- name: Build iOS (debug)
working-directory: ./reader-sdk-react-native-quickstart/ios
run: xcodebuild -workspace RNReaderSDKSample.xcworkspace -configuration Debug -scheme RNReaderSDKSample -destination "platform=iOS Simulator,OS=16.2,name=iPhone 14"