diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5284d40c4..000000000 --- a/.travis.yml +++ /dev/null @@ -1,46 +0,0 @@ -# references: -# * https://www.objc.io/issues/6-build-tools/travis-ci/ -# * https://github.com/supermarin/xcpretty#usage - -osx_image: xcode10.2 -language: swift - -jobs: - include: - - stage: lint - osx_image: xcode10.2 - language: swift - before_install: - - brew install swiftformat - script: - # temporarily disabled due to Swift ABI issues on Xcode 10.2, Mojave 10.14.4 - - swiftformat --lint --verbose . - - swiftlint - - &test - stage: test - osx_image: xcode10.2 - language: swift - install: skip - env: TEST_DEVICE='platform=iOS Simulator,OS=12.2,name=iPhone SE' - script: - - swift package generate-xcodeproj --xcconfig-overrides Package.xcconfig - - git checkout HEAD Tokamak.xcodeproj/xcshareddata/xcschemes/TokamakCLI.xcscheme - - set -o pipefail && xcodebuild -scheme TokamakUIKit -sdk iphonesimulator | xcpretty - - set -o pipefail && xcodebuild -scheme TokamakAppKit -sdk macosx | xcpretty - # this runs the build the second time, but it's the only way to make sure - # that `Package.swift` is in a good state - - swift build --target Tokamak - - set -o pipefail && xcodebuild test -enableCodeCoverage YES -scheme Tokamak | xcpretty - after_success: - - bash <(curl -s https://codecov.io/bash) -# before_install: -# - gem install cocoapods --pre # Since Travis is not always on latest version -# - brew outdated carthage || brew upgrade carthage -# cache: cocoapods -# podfile: Example/Podfile -# before_install: -# - gem install cocoapods # Since Travis is not always on latest version -# - pod install --project-directory=Example -# - swift build -# - set -o pipefail && set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/Tokamak.xcworkspace -scheme Tokamak-Example -sdk iphonesimulator11.0 ONLY_ACTIVE_ARCH=NO | xcpretty -# - pod lib lint diff --git a/README.md b/README.md index e6c159f59..563c4284d 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ## React-like framework for native UI written in pure Swift 🛠⚛️📲 -[![CI Status](https://img.shields.io/travis/MaxDesiatov/Tokamak/master.svg?style=flat)](https://travis-ci.org/MaxDesiatov/Tokamak) +[![Build Status](https://dev.azure.com/max0484/max/_apis/build/status/MaxDesiatov.Tokamak?branchName=master)](https://dev.azure.com/max0484/max/_build/latest?definitionId=3&branchName=master) [![Coverage](https://img.shields.io/codecov/c/github/MaxDesiatov/Tokamak/master.svg?style=flat)](https://codecov.io/gh/maxdesiatov/Tokamak) [![Version](https://img.shields.io/cocoapods/v/Tokamak.svg?style=flat)](https://cocoapods.org/pods/Tokamak) [![License](https://img.shields.io/cocoapods/l/Tokamak.svg?style=flat)](https://cocoapods.org/pods/Tokamak) diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 000000000..2c4f9e11f --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,21 @@ +trigger: + - master + +jobs: + - job: lint + pool: + vmImage: "macos-latest" + steps: + - bash: ./lint.sh + + - job: test + pool: + vmImage: "macos-latest" + steps: + - bash: ./test.sh + env: + IOS_DEVICE: "platform=iOS Simulator,OS=12.2,name=iPhone SE" + - bash: ./codecov.sh + env: + CODECOV_TOKEN: $(codecovToken) + condition: succeeded() diff --git a/codecov.sh b/codecov.sh new file mode 100755 index 000000000..b1347c515 --- /dev/null +++ b/codecov.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +set -e +set -o pipefail + +bash <(curl -s https://codecov.io/bash) \ No newline at end of file diff --git a/lint.sh b/lint.sh new file mode 100755 index 000000000..b30663d5c --- /dev/null +++ b/lint.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +set -e +set -o pipefail + +brew update +brew install swiftformat swiftlint + +swiftformat --lint --verbose . +swiftlint \ No newline at end of file diff --git a/test.sh b/test.sh new file mode 100755 index 000000000..d4166529b --- /dev/null +++ b/test.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +swift package generate-xcodeproj --xcconfig-overrides Package.xcconfig +git checkout HEAD Tokamak.xcodeproj/xcshareddata/xcschemes/TokamakCLI.xcscheme +set -o pipefail && xcodebuild -scheme TokamakUIKit -sdk iphonesimulator | xcpretty +set -o pipefail && xcodebuild -scheme TokamakAppKit -sdk macosx | xcpretty +# this runs the build the second time, but it's the only way to make sure +# that `Package.swift` is in a good state +swift build --target Tokamak +set -o pipefail && xcodebuild test -enableCodeCoverage YES -scheme Tokamak | xcpretty \ No newline at end of file