diff --git a/.pipelines/ios-ci.yml b/.pipelines/ios-ci.yml new file mode 100644 index 0000000000..14b631f767 --- /dev/null +++ b/.pipelines/ios-ci.yml @@ -0,0 +1,25 @@ +# Xcode +# Build, test, and archive an Xcode workspace on macOS. +# Add steps that install certificates, test, sign, and distribute an app, save build artifacts, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/xcode + +name: $(Year:yy).$(Month).$(DayOfMonth).$(rev:r) + +pr: + branches: + include: + - main + - feature/* + - release/* + +schedules: + - cron: "0 0 * * 6" + displayName: testing + branches: + include: + - main +pool: + vmImage: 'macos-latest' + +steps: + - template: templates/ios-ci-template.yml diff --git a/.pipelines/ios-heartbeat.yml b/.pipelines/ios-heartbeat.yml new file mode 100644 index 0000000000..f593913af2 --- /dev/null +++ b/.pipelines/ios-heartbeat.yml @@ -0,0 +1,65 @@ +name: $(Year:yy).$(Month).$(DayOfMonth).$(rev:r) + +pr: none +trigger: none + +schedules: + - cron: "1 7 1,15 * *" + displayName: Send Heartbeat + branches: + include: + - main +jobs: + - job: specLint + displayName: 'check podspec health' + pool: + vmImage: 'macos-latest' + steps: + - template: templates/ios-spec-lint-template.yml + + - job: unitTest + displayName: 'check code health' + pool: + vmImage: 'macos-latest' + steps: + - template: templates/ios-ci-template.yml + + - job: certificateCheck + displayName: 'check certificate health' + pool: + vmImage: 'macos-latest' + steps: + - template: templates/ios-install-cert-template.yml + + - job: + pool: + vmImage: 'windows-latest' + displayName: 'collect result' + dependsOn: + - specLint + - unitTest + - certificateCheck + condition: always() + variables: + j1: $[dependencies.specLint.result] + j2: $[dependencies.unitTest.result] + j3: $[dependencies.certificateCheck.result] + steps: + - task: PkgESSendMail@10 + inputs: + to: 'adaptivecardscore@microsoft.com' + subject: 'iOS Release Pipeline Health Check' + bodyType: 'string' + body: | + + + +

iOS Release Pipeline Health Check Report

+
    +
  1. spec linting check has $(j1)
  2. +
  3. code health check has $(j2)
  4. +
  5. certificate check has $(j3)
  6. +
+ + + isHtml: true diff --git a/.pipelines/templates/ios-build-template.yml b/.pipelines/templates/ios-build-template.yml new file mode 100644 index 0000000000..8ae3f24c10 --- /dev/null +++ b/.pipelines/templates/ios-build-template.yml @@ -0,0 +1,37 @@ +parameters: + - name: 'sdk' + default: 'iphonesimulator' + type: string + + - name: 'signingOption' + default: 'default' + type: string + + - name: 'packageApp' + default: false + type: boolean + + - name: 'configuration' + default: 'Debug' + type: string + +steps: +- task: CocoaPods@0 + displayName: 'Installing dependency via pod' + inputs: + workingDirectory: 'source/ios/AdaptiveCards' + forceRepoUpdate: false + +- task: Xcode@5 + displayName: 'Compiling...' + inputs: + actions: 'build' + xcWorkspacePath: 'source/ios/AdaptiveCards/AdaptiveCards.xcworkspace' + scheme: 'ADCIOSVisualizer' + xcodeVersion: '12' + packageApp: ${{ parameters.packageApp }} + signingOption: ${{ parameters.signingOption }} + sdk: ${{ parameters.sdk }} + configuration: ${{ parameters.configuration }} + destinationPlatformOption: 'iOS' + destinationSimulators: 'iPhone 12' diff --git a/.pipelines/templates/ios-ci-template.yml b/.pipelines/templates/ios-ci-template.yml new file mode 100644 index 0000000000..2e54f36777 --- /dev/null +++ b/.pipelines/templates/ios-ci-template.yml @@ -0,0 +1,29 @@ +steps: +- template: ios-build-template.yml + +- task: Xcode@5 + displayName: 'Sample App Unit Test' + inputs: + actions: 'test' + xcWorkspacePath: 'source/ios/AdaptiveCards/AdaptiveCards.xcworkspace' + scheme: 'ADCIOSVisualizer' + xcodeVersion: '12' + packageApp: false + signingOption: 'default' + sdk: 'iphonesimulator' + destinationPlatformOption: 'iOS' + destinationSimulators: 'iPhone 12' + +- task: Xcode@5 + + displayName: 'Framework Unit Test' + inputs: + actions: 'test' + xcWorkspacePath: 'source/ios/AdaptiveCards/AdaptiveCards.xcworkspace' + scheme: 'AdaptiveCards' + xcodeVersion: '12' + packageApp: false + signingOption: 'default' + sdk: 'iphonesimulator' + destinationPlatformOption: 'iOS' + destinationSimulators: 'iPhone 12' diff --git a/.pipelines/templates/ios-install-cert-template.yml b/.pipelines/templates/ios-install-cert-template.yml new file mode 100644 index 0000000000..ddbb532b8d --- /dev/null +++ b/.pipelines/templates/ios-install-cert-template.yml @@ -0,0 +1,20 @@ +steps: +- task: InstallAppleCertificate@2 + displayName: 'Install Certificates' + inputs: + certSecureFile: 'Certificates_Nov_19_B.p12' + certPwd: '$(P12password)' + keychain: 'temp' + +- task: InstallAppleProvisioningProfile@1 + displayName: 'Install Provisioning Profile' + inputs: + provisioningProfileLocation: 'secureFiles' + provProfileSecureFile: 'a5e2ba07-6d9f-4254-abf0-ad59b7effefa.mobileprovision' + +- template: ios-build-template.yml + parameters: + sdk: iphoneos + signingOption: auto + packageApp: true + configuration: Release diff --git a/.pipelines/templates/ios-spec-lint-template.yml b/.pipelines/templates/ios-spec-lint-template.yml new file mode 100644 index 0000000000..465fa6f7b2 --- /dev/null +++ b/.pipelines/templates/ios-spec-lint-template.yml @@ -0,0 +1,8 @@ +steps: +- task: Bash@3 + displayName: 'Spec Lint' + inputs: + targetType: 'inline' + script: | + # Write your commands here + pod spec lint ./source/ios/tools/AdaptiveCards.podspec --allow-warnings diff --git a/source/ios/AdaptiveCards/AdaptiveCards/AdaptiveCardsTests/TestFiles/Action.ToggleVisibilityExhaustive.json b/source/ios/AdaptiveCards/AdaptiveCards/AdaptiveCardsTests/TestFiles/Action.ToggleVisibilityExhaustive.json new file mode 100644 index 0000000000..2358e4191e --- /dev/null +++ b/source/ios/AdaptiveCards/AdaptiveCards/AdaptiveCardsTests/TestFiles/Action.ToggleVisibilityExhaustive.json @@ -0,0 +1,152 @@ +{ + "type": "AdaptiveCard", + "version": "1.2", + "body": [ + { + "type": "TextBlock", + "text": "Press the buttons to toggle the images!", + "wrap": true + }, + { + "type": "TextBlock", + "text": "Here are some images:", + "isVisible": false, + "id": "textToToggle" + }, + { + "type": "ColumnSet", + "columns": [ + { + "type": "Column", + "expected": { + "numberOfViews" : "0", + "visible" : true + }, + "items": [ + { + "style": "person", + "type": "Image", + "url": "https://picsum.photos/100/100?image=112", + "isVisible": false, + "id": "imageToToggle", + "altText": "sample image 1", + "size": "medium" + } + ] + }, + { + "type": "Column", + "expected": { + "numberOfViews" : "2", + "visible" : true + }, + "items": [ + + { + "type": "Image", + "url": "https://picsum.photos/100/100?image=123", + "isVisible": true, + "id": "imageToToggle2", + "altText": "sample image 2", + "size": "medium" + } + ] + } + ] + } + ], + "actions": [ + { + "type": "Action.ToggleVisibility", + "title": "Toggle!", + "targetElements": [ "textToToggle", "imageToToggle", "imageToToggle2" ] + }, + { + "type": "Action.ToggleVisibility", + "title": "Also Toggle!", + "targetElements": [ + { + "elementId": "textToToggle" + }, + { + "elementId": "imageToToggle" + }, + { + "elementId": "imageToToggle2" + } + ] + }, + { + "type": "Action.ToggleVisibility", + "title": "Show!", + "targetElements": [ + { + "elementId": "textToToggle", + "isVisible": true + }, + { + "elementId": "imageToToggle", + "isVisible": true + }, + { + "elementId": "imageToToggle2", + "isVisible": true + } + ] + }, + { + "type": "Action.ToggleVisibility", + "title": "Hide!", + "targetElements": [ + { + "elementId": "textToToggle", + "isVisible": false + }, + { + "elementId": "imageToToggle", + "isVisible": false + }, + { + "elementId": "imageToToggle2", + "isVisible": false + } + ] + }, + { + "type": "Action.ToggleVisibility", + "title": "Grain!", + "targetElements": [ + { + "elementId": "textToToggle", + "isVisible": true + }, + { + "elementId": "imageToToggle", + "isVisible": true + }, + { + "elementId": "imageToToggle2", + "isVisible": false + } + ] + }, + { + "type": "Action.ToggleVisibility", + "title": "Water!", + "targetElements": [ + { + "elementId": "textToToggle", + "isVisible": true + }, + { + "elementId": "imageToToggle", + "isVisible": false + }, + { + "elementId": "imageToToggle2", + "isVisible": true + } + ] + } + ] +}