Nightly build #1378
This file contains 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
--- | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
jobs: | |
build: | |
name: Build | |
runs-on: macos-15-xlarge | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
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: Authenticate to Google Cloud | |
uses: google-github-actions/auth@v1 | |
with: | |
credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }} | |
- name: Set up Cloud SDK | |
uses: google-github-actions/setup-gcloud@v2 | |
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 -quiet | |
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=iphone13pro,version=16.6,locale=en_GB --device model=iphone8,version=15.7,locale=en_GB --device model=iphone12pro,version=14.8,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: | |
webhook_url: '${{env.SLACK_WEBHOOK}}' | |
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: |