[APP-2876] Create (or update) test suite #271
Workflow file for this run
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
name: Xcode - Build and Analyze | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
- feature/* | |
pull_request: | |
branches: | |
- main | |
- develop | |
- feature/* | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.ref_name }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
name: Test iOS | |
runs-on: macOS-12 | |
env: | |
DEVELOPER_DIR: "/Applications/Xcode_14.1.app/Contents/Developer" | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: "Run tests" | |
run: xcodebuild -project "attentive-ios-sdk.xcodeproj" -scheme "attentive-ios-sdk-framework" -destination "platform=iOS Simulator,OS=16.1,name=iPhone 13 Pro" test | |
ui-tests: | |
name: Run iOS UI Tests | |
runs-on: macOS-14 | |
env: | |
DEVELOPER_DIR: "/Applications/Xcode_15.3.app/Contents/Developer" | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: "Run UI Tests" | |
run: | | |
set -o pipefail | |
xcodebuild -workspace "attentive-ios-sdk.xcworkspace" -scheme "CreativeUITest" -destination "platform=iOS Simulator,OS=17.4,name=iPhone 15 Pro" -derivedDataPath build/ -resultBundlePath ui-test-results.xcresult -testPlan "Example - Local" test | xcpretty | |
- name: Compress UI Test Results | |
if: failure() | |
run: tar -czf ui-test-results.xcresult.tar.gz ui-test-results.xcresult | |
- name: Upload UI Test Results | |
if: failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ui-test-results | |
path: ui-test-results.xcresult.tar.gz | |
lint: | |
name: Run lint | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: "Install clang-format" | |
run: sudo apt -y install clang-format-11 | |
- name: "Run lint" | |
run: | | |
echo "Running lint" | |
find . \( \ | |
-path "./Vendor/*" -prune -o \ | |
-path "./*/Pods/*" -prune -o \ | |
-path "./DerivedData/*" -prune -o \ | |
-path "./build/*" -prune -o \ | |
-path "./*/DerivedData/*" -prune -o \ | |
-path "./*/build/*" -prune -o \ | |
-path "./attentive-ios-sdk.xc*" -prune \ | |
\) \ | |
-o -name "*.h" -o -name "*.m" -print | xargs clang-format --dry-run --Werror --assume-filename=Objective-C |