Skip to content

Nightly build

Nightly build #840

---
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
jobs:
build:
name: Build
runs-on: macos-11
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: dev
- name: Remove old directories
run: rm -rf ~/tmp | rm -rf ~/Library/MobileDevice
shell: bash
- name: Install provisioning profile for tests
uses: davidSchuppa/base64Secret-toFile-action@v1
with:
destination-path: ~/Library/MobileDevice/Provisioning\ Profiles/
filename: SDKHost.mobileprovision
secret: ${{ secrets.SDK_HOST_MOBILEPROVISION_BASE64 }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v0
with:
project_id: ${{ secrets.GCP_PROJECT }}
service_account_key: ${{ secrets.FIREBASE_SERVICE_KEY_BASE64 }}
- name: Setup Test Certs
uses: apple-actions/import-codesign-certs@v1
with:
keychain-password: ${{ secrets.KEYCHAIN_PASS }}
p12-file-base64: ${{ secrets.SDK_TEAM_P12_BASE64 }}
p12-password: ${{ secrets.SDK_TEAM_PASS }}
- name: Install Dependencies
run: pod install --no-repo-update --verbose
shell: bash
- name: Build For Testing
run: xcodebuild -workspace ~/work/ios-emarsys-sdk/ios-emarsys-sdk/EmarsysSDK.xcworkspace -scheme Tests -configuration Debug -destination generic/platform=iOS build-for-testing -allowProvisioningUpdates -derivedDataPath ~/tmp
shell: bash
- name: Zip Test Files For Firebase
run: cd ~/tmp/Build/Products && zip -r ~/Tests.zip ./
shell: bash
- name: Run tests on Firebase
uses: nick-invision/retry@v2
with:
command: gcloud firebase test ios run --quiet --test ~/Tests.zip --device model=iphone11pro,version=16.3,locale=en_GB --device model=iphone13pro,version=15.7,locale=en_GB --device model=iphone11pro,version=14.7,locale=en_GB
max_attempts: 3
retry_on: error
timeout_minutes: 30
- name: Trigger Sample App Build
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
event-type: build-sample
- if: ${{ failure() }}
name: Slack Notification On Error
uses: megamegax/[email protected]
with:
actions: '[{ "type": "button", "text": "View actions", "url": "https://github.com/emartech/ios-emarsys-sdk/actions" },{ "type": "button", "text": "View Firebase", "url": "https://console.firebase.google.com/project/ems-mobile-sdk/testlab/histories/" }]'
channel: ${{ secrets.SLACK_CHANNEL }}
job_status: failure
message: 'Nightly build failed! :sob:'
user_icon: https://img.pngio.com/rotten-apple-png-images-vectors-and-psd-files-free-download-on-png-rotten-apple-260_391.png
user_name: Emarsys SDK - iOS
name: Nightly build
'on':
schedule:
- cron: 0 2 * * *
workflow_dispatch: