summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2020-06-04 10:28:31 -0400
committerGitHub <noreply@github.com>2020-06-04 10:28:31 -0400
commitc85fa9d2b2ec270ea5014d3a650c90221ee7402a (patch)
tree3a8c802b0bdc23d56fd069f69e9953c7b2156f4a
parent37cb5edcd23a8228b8db2f7dc5bd3360c88cb9f7 (diff)
parent66b08e7bf097655f2d0a93d4a3cec316f2e6a09d (diff)
downloadsdl_ios-c85fa9d2b2ec270ea5014d3a650c90221ee7402a.tar.gz
Merge pull request #1671 from smartdevicelink/feature/issue_1670_github_actions_CI
Added support for GitHub Actions CI
-rw-r--r--.github/workflows/test.yml82
-rw-r--r--.travis.yml28
-rw-r--r--README.md2
3 files changed, 83 insertions, 29 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 000000000..04b9bbea6
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,82 @@
+name: SmartDeviceLink Tests
+
+# This workflow is triggered on a push or pull request.
+on:
+ push:
+ # Runs the workflow when someone pushes to any repository branch.
+ pull_request:
+ # Runs the workflow only when someone opens a pull request (there are a bunch of activity types that can trigger a workflow that we don't want - like labeling, assigning, and locking the PR). The "push" trigger will generate a new workflow if a push is made to a pull request branch.
+ types: [opened]
+
+env:
+ PROJECT: 'SmartDeviceLink-iOS.xcodeproj'
+ DESTINATION: 'platform=iOS Simulator,name=iPhone 11,OS=13.5'
+
+jobs:
+ build:
+ name: Build Example Apps
+ runs-on: macOS-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ scheme: ['SmartDeviceLink-Example-ObjC', 'SmartDeviceLink-Example-Swift']
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v2
+ with:
+ submodules: true
+
+ # Print the available Xcode versions
+ - name: Get available Xcode versions on the server
+ run: ls /Applications | grep Xcode
+
+ # Select the Xcode version (the platform/simulator/OS available for testing depend on the Xcode version)
+ - name: Select Xcode version
+ run: sudo xcode-select -switch /Applications/Xcode_11.5.app
+
+ - name: Build
+ run: set -o pipefail && xcodebuild -scheme "${{ matrix.scheme }}" -destination "$DESTINATION" build | xcpretty --color --simple
+
+ test:
+ name: SmartDeviceLinkTests
+ runs-on: macOS-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ scheme: ['SmartDeviceLink']
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v2
+ with:
+ submodules: true
+
+ - name: Checking for cached dependencies
+ uses: actions/cache@v2
+ id: carthage-cache
+ with:
+ path: Carthage
+ key: ${{ runner.os }}-carthage-${{ hashFiles('**/Cartfile.resolved') }}
+ restore-keys: ${{ runner.os }}-carthage-
+
+ - name: Installing dependencies
+ if: steps.carthage-cache.outputs.cache-hit != 'true'
+ run: carthage bootstrap --no-use-binaries --platform iOS --cache-builds
+
+ # Print the available Xcode versions
+ - name: Get available Xcode versions on the server
+ run: ls /Applications | grep Xcode
+
+ # Select the Xcode version (the platform/simulator/OS available for testing depend on the Xcode version)
+ - name: Select Xcode version
+ run: sudo xcode-select -switch /Applications/Xcode_11.5.app
+
+ # Split build into build-only and test-only as it is faster than building and running in one step
+ - name: Building unit tests
+ run: xcodebuild build-for-testing -project "$PROJECT" -destination "$DESTINATION" -scheme "${{ matrix.scheme }}"
+
+ - name: Running unit tests
+ run: set -o pipefail && xcodebuild test-without-building -project "$PROJECT" -destination "$DESTINATION" -scheme "${{ matrix.scheme }}" -configuration Debug ONLY_ACTIVE_ARCH=NO RUN_CLANG_STATIC_ANALYZER=NO GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES ENABLE_TESTABILITY=YES | xcpretty --color --simple
+
+ # Upload coverage reports to Codecov
+ - name: Upload coverage to Codecov
+ uses: codecov/codecov-action@v1
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index b05a77162..000000000
--- a/.travis.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-language: objective-c
-osx_image: xcode11.2
-xcode_project: SmartDeviceLink-iOS.xcodeproj
-xcode_scheme: SmartDeviceLink
-xcode_sdk: iphonesimulator13.2
-env:
- global:
- - FRAMEWORK_NAME=SmartDeviceLink
-
-cache:
- directories:
- - Carthage
-
-notifications:
- email: false
-
-before_install:
-- brew update
-- brew outdated carthage || brew upgrade carthage
-- carthage bootstrap --verbose --no-use-binaries --platform iOS --cache-builds
-
-script:
-- set -o pipefail && xcodebuild -project "SmartDeviceLink-iOS.xcodeproj" -scheme "SmartDeviceLink-Example-ObjC" -destination "platform=iOS Simulator,OS=13.2.2,name=iPhone 11" -configuration Debug ONLY_ACTIVE_ARCH=NO RUN_CLANG_STATIC_ANALYZER=NO build | xcpretty -c;
-- set -o pipefail && xcodebuild -project "SmartDeviceLink-iOS.xcodeproj" -scheme "SmartDeviceLink-Example-Swift" -destination "platform=iOS Simulator,OS=13.2.2,name=iPhone 11" -configuration Debug ONLY_ACTIVE_ARCH=NO RUN_CLANG_STATIC_ANALYZER=NO build | xcpretty -c;
-- set -o pipefail && xcodebuild -project "SmartDeviceLink-iOS.xcodeproj" -scheme "SmartDeviceLink" -destination "platform=iOS Simulator,OS=13.2.2,name=iPhone 11" -configuration Debug ONLY_ACTIVE_ARCH=NO RUN_CLANG_STATIC_ANALYZER=NO GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES ENABLE_TESTABILITY=YES test | xcpretty -c;
-
-after_success:
-- bash <(curl -s https://codecov.io/bash) -J 'SmartDeviceLink'
diff --git a/README.md b/README.md
index b190a5cb5..55b24f4ac 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![Version](https://img.shields.io/cocoapods/v/SmartDeviceLink-iOS.svg?style=flat)](https://cocoapods.org/pods/SmartDeviceLink-iOS)
[![License](https://img.shields.io/cocoapods/l/SmartDeviceLink-iOS.svg?style=flat)](https://cocoapods.org/pods/SmartDeviceLink-iOS)
-[![Build Status](https://img.shields.io/travis/smartdevicelink/sdl_ios/master.svg?style=flat)](https://travis-ci.org/smartdevicelink/sdl_ios)
+![SmartDeviceLink Tests](https://github.com/smartdevicelink/sdl_ios/workflows/SmartDeviceLink%20Tests/badge.svg)
[![codecov](https://codecov.io/gh/smartdevicelink/sdl_ios/branch/master/graph/badge.svg)](https://codecov.io/gh/smartdevicelink/sdl_ios)
[![Documentation](docs/badge.svg)](https://smartdevicelink.com/en/guides/iOS/getting-started/installation/)
[![Slack Status](http://sdlslack.herokuapp.com/badge.svg)](http://slack.smartdevicelink.com)