diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3fb172f0..00000000 --- a/.travis.yml +++ /dev/null @@ -1,62 +0,0 @@ -osx_image: xcode10.2 -language: swift - -env: - global: - - FRAMEWORK_NAME=XMLCoder - -jobs: - include: - - stage: lint - osx_image: xcode10.2 - language: swift - before_install: - - brew update - - brew install swiftformat - - brew outdated swiftlint || brew upgrade swiftlint - script: - - swiftformat --lint --verbose . - - swiftlint - - pod lib lint --verbose - - &test - stage: test - osx_image: xcode10 - language: swift - install: skip - env: TEST_DEVICE='platform=iOS Simulator,OS=12.0,name=iPhone SE' - script: - - > - xcodebuild test -enableCodeCoverage YES -scheme XMLCoder - -sdk iphonesimulator -destination "$TEST_DEVICE" | xcpretty - - > - xcodebuild test -enableCodeCoverage YES -scheme XMLCoder - -sdk macosx | xcpretty - # this runs the tests the second time, but it's the only way to make sure - # that `Package.swift` is in a good state and `swift test` can only generate - # coverage reports in Swift 5.0, see this issue for more details: - # https://github.com/apple/swift-package-manager/pull/1787 - - swift test - - <<: *test - osx_image: xcode10.1 - env: TEST_DEVICE='platform=iOS Simulator,OS=12.1,name=iPhone SE' - - <<: *test - osx_image: xcode10.2 - env: TEST_DEVICE='platform=iOS Simulator,OS=12.2,name=iPhone SE' - after_success: - - bash <(curl -s https://codecov.io/bash) - before_deploy: - - brew outdated carthage || brew upgrade carthage - - carthage build --no-skip-current - - carthage archive $FRAMEWORK_NAME - deploy: - provider: releases - api_key: - secure: yACVlrO+oqAPJ7NS2N2Cut8eCTO0yWWKuV9510tpwmsCKuHUJZ9fT1Z4zhteghGiDZJzZHzMteSK3YPHeCFBbZJAq95HeWV8ki0Cs+7tL8jO0U1zniilb/vk4MvT3z7QdzueXO+DHBw9nbszARwbfgBAWhkPbt9zKwk882Hoke5M9mfbQ9kUHNH+jTV5R7FdtkbkGpo1zzEglYZT0IshLTbBSlBjqEu9kJSJxTQjciKu6f/DvDYgV0AyXqi96hlmaSrTE9vM6bRxbN+t9QNAtlXxlB4mGiprKR8et1MFJHR9ECIpbzfsAWzehPtSksfXLgAfq0z0fIR3RRN4w76oMgAQcBS1xPnDFXjyMDv+QJHfXcGsACubU10FxZDHinF3odRzzAuQI2mxcvFJ7rcPVpe/Y1M1otxyRAlj3AE3yMp3eoTqoByjym/ckBSs9Ui5kgWIaQPtaGx6HkFFGjZlbxkNLcd6cQjrhAOUVF0FjABcdOi0ZM1HpBusdcdEx4aA68XcrZvWi9zWeG9rHb9Z20hJKme/zkuiAbKtwDFJ3y+WiQK27JtKTgz4VtDbtiWpjaj1Uw8FhbE/X+9fuN09HSfN5n/NDuIoDJtyAxBkalxGMggeWWHCb6vjYk9+jubyOYctGBh4jbRuSp2QMdR62GlghVa0ARSGiQOOWGEk6LU= - file: "$FRAMEWORK_NAME.framework.zip" - skip_cleanup: true - on: - repo: MaxDesiatov/XMLCoder - tags: true - -# this is commented because installing Jazzy on Travis doesn't work ¯\_(ツ)_/¯ -# - ./docs.sh diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 00000000..2723c386 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,45 @@ +trigger: +- master + +jobs: +- job: lint + pool: + vmImage: 'macos-latest' + steps: + - bash: ./lint.sh +- job: pod + pool: + vmImage: 'macos-latest' + steps: + - bash: ./pod.sh +- job: test_xcodebuild_10_0 + pool: + vmImage: 'macos-latest' + steps: + - bash: ./test_xcodebuild.sh Xcode_10 + env: + IOS_DEVICE: 'platform=iOS Simulator,OS=12.0,name=iPhone SE' + TVOS_DEVICE: 'platform=tvOS Simulator,OS=12.0,name=Apple TV 4K' +- job: test_xcodebuild_10_1 + pool: + vmImage: 'macos-latest' + steps: + - bash: ./test_xcodebuild.sh Xcode_10.1 + env: + IOS_DEVICE: 'platform=iOS Simulator,OS=12.1,name=iPhone SE' + TVOS_DEVICE: 'platform=tvOS Simulator,OS=12.1,name=Apple TV 4K' +- job: test_xcodebuild_10_2 + pool: + vmImage: 'macos-latest' + steps: + - bash: ./test_xcodebuild.sh Xcode_10.2.1 + env: + IOS_DEVICE: 'platform=iOS Simulator,OS=12.2,name=iPhone SE' + TVOS_DEVICE: 'platform=tvOS Simulator,OS=12.2,name=Apple TV 4K' + CODECOV_JOB: 'true' + CODECOV_TOKEN: $(codecovToken) +- job: test_swiftpm + pool: + vmImage: 'macos-latest' + steps: + - script: ./test_swiftpm.sh diff --git a/lint.sh b/lint.sh new file mode 100755 index 00000000..08e52b35 --- /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 diff --git a/pod.sh b/pod.sh new file mode 100755 index 00000000..21cdaf99 --- /dev/null +++ b/pod.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +set -e +set -o pipefail + +pod repo update +pod lib lint --verbose diff --git a/test_swiftpm.sh b/test_swiftpm.sh new file mode 100755 index 00000000..42066cc0 --- /dev/null +++ b/test_swiftpm.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +set -e +set -o pipefail + +swift test diff --git a/test_xcodebuild.sh b/test_xcodebuild.sh new file mode 100755 index 00000000..cef0b066 --- /dev/null +++ b/test_xcodebuild.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +set -e +set -o pipefail + +sudo xcode-select --switch /Applications/$1.app/Contents/Developer + +xcodebuild -version +xcodebuild build -scheme XMLCoder \ + -sdk iphonesimulator -destination "$IOS_DEVICE" | xcpretty +xcodebuild build -scheme XMLCoder \ + -sdk appletvsimulator -destination "$TVOS_DEVICE" | xcpretty + +if [ -n "$CODECOV_JOB" ]; then + xcodebuild test -enableCodeCoverage YES -scheme XMLCoder \ + -sdk macosx | xcpretty + bash <(curl -s https://codecov.io/bash) +else + xcodebuild test -scheme XMLCoder \ + -sdk macosx | xcpretty +fi