Skip to content

Merge feature/button to master #561

Merge feature/button to master

Merge feature/button to master #561

Workflow file for this run

name: Build and Test
env:
afterpay-scheme: Afterpay
DEVELOPER_DIR: /Applications/Xcode_14.3.1.app/Contents/Developer
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build-and-test:
name: Build and Test
runs-on: macos-latest
env:
destination: platform=iOS Simulator,name=iPhone 14,OS=16.4
example-scheme: Example
example-ui-test-scheme: ExampleUITests
workspace: Afterpay.xcworkspace
steps:
- uses: actions/checkout@v3
- name: Cache Mint Packages
uses: actions/cache@v3
with:
path: /usr/local/lib/mint
key: ${{ runner.os }}-mint-${{ hashFiles('Mintfile') }}
restore-keys: |
${{ runner.os }}-mint-
- name: Install Dependencies
run: Tools/mint/mint bootstrap
- name: SwiftLint
run: Tools/mint/mint run swiftlint --reporter github-actions-logging
- name: Build SDK Project
run: |
xcodebuild build-for-testing \
-workspace ${{ env.workspace }} \
-scheme ${{ env.afterpay-scheme }} \
-destination '${{ env.destination }}'
- name: Test SDK Project
run: |
xcodebuild test-without-building \
-workspace ${{ env.workspace }} \
-scheme ${{ env.afterpay-scheme }} \
-destination '${{ env.destination }}'
- name: Build Example Project
run: |
xcodebuild \
-workspace ${{ env.workspace }} \
-scheme ${{ env.example-scheme }} \
-skipPackagePluginValidation \
-destination '${{ env.destination }}'
- name: Checkout Example Server
uses: actions/checkout@v3
with:
repository: afterpay/sdk-example-server
path: ./example-server
- name: Setup Example Server
uses: actions/setup-node@v3
with:
node-version: 16
- name: Run Example Server
working-directory: ./example-server
run: |
npm install
npm run build
npm run start &
env:
AFTERPAY_MERCHANT_ID: ${{ secrets.AFTERPAY_MERCHANT_ID_AU }}
AFTERPAY_SECRET_KEY: ${{ secrets.AFTERPAY_SECRET_KEY_AU }}
AFTERPAY_REGION: AU
- name: UI Test SDK Project
run: |
xcodebuild build-for-testing \
-workspace ${{ env.workspace }} \
-scheme ${{ env.example-ui-test-scheme }} \
-skipPackagePluginValidation \
-destination '${{ env.destination }}'
xcodebuild test-without-building \
-workspace ${{ env.workspace }} \
-scheme ${{ env.example-ui-test-scheme }} \
-destination '${{ env.destination }}'
- name: Upload UI test artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: xcresults
path: /Users/runner/Library/Developer/Xcode/DerivedData/Afterpay-*/Logs/Test/*
validate-cocoapods:
name: Validate Pod
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Dependencies
run: gem install cocoapods
- name: Validate Pod
run: |
export LIB_VERSION=$(git describe --tags `git rev-list --tags --max-count=1`)
pod lib lint
validate-swift-package:
name: Validate Swift Package
runs-on: macos-latest
env:
destination: platform=macOS,variant=Mac Catalyst
workspace: .swiftpm/xcode/package.xcworkspace
steps:
- uses: actions/checkout@v3
- name: Validate Swift Package
run: |
xcodebuild \
-workspace ${{ env.workspace }} \
-scheme ${{ env.afterpay-scheme }} \
-destination '${{ env.destination }}'