129 lines
3.8 KiB
YAML
129 lines
3.8 KiB
YAML
# only run for: merge commits, releases and pull-requests
|
||
if: type != push OR branch = master OR branch =~ /^deploy-\d+\.\d+\.\d+(-.*)?$/ OR branch =~ /^\d+\.\d+\.\d+(-.*)?$/
|
||
|
||
stages:
|
||
- name: pretest
|
||
if: NOT branch =~ /^deploy-\d+\.\d+\.\d+(-.*)?$/
|
||
- name: test
|
||
if: NOT branch =~ /^deploy-\d+\.\d+\.\d+(-.*)?$/
|
||
- name: deploy
|
||
if: branch =~ /^deploy-\d+\.\d+\.\d+(-.*)?$/
|
||
- name: publish
|
||
if: branch =~ /^\d+\.\d+\.\d+(-.*)?$/
|
||
|
||
os: osx
|
||
language: swift
|
||
osx_image: xcode10.1
|
||
xcode_project: Path.swift.xcodeproj
|
||
xcode_scheme: Path.swift-Package
|
||
|
||
jobs:
|
||
include:
|
||
- name: macOS / Swift 4.0.3
|
||
before_script: swift build -Xswiftc -warnings-as-errors
|
||
script: swift test --parallel -Xswiftc -swift-version -Xswiftc 4
|
||
|
||
- &std
|
||
name: macOS / Swift 4.2.1
|
||
before_script: swift build -Xswiftc -warnings-as-errors
|
||
script: swift test --parallel
|
||
|
||
- <<: *std
|
||
name: macOS / Swift 5.0
|
||
osx_image: xcode10.2
|
||
|
||
- <<: *std
|
||
name: macOS / Swift 5.1
|
||
osx_image: xcode11
|
||
|
||
- &xcodebuild
|
||
before_install: swift package generate-xcodeproj --enable-code-coverage
|
||
xcode_destination: platform=iOS Simulator,OS=latest,name=iPhone XS
|
||
name: iOS / Swift 4.2.1
|
||
after_success: bash <(curl -s https://codecov.io/bash)
|
||
|
||
- <<: *xcodebuild
|
||
xcode_destination: platform=tvOS Simulator,OS=latest,name=Apple TV
|
||
name: tvOS / Swift 4.2.1
|
||
|
||
- <<: *xcodebuild
|
||
name: watchOS / Swift 4.2.1
|
||
script: |
|
||
set -o pipefail
|
||
xcodebuild \
|
||
-project Path.swift.xcodeproj \
|
||
-scheme Path.swift-Package \
|
||
-destination 'platform=watchOS Simulator,OS=latest,name=Apple Watch Series 4 - 40mm' \
|
||
build | xcpretty
|
||
after_success: false
|
||
|
||
- &linux
|
||
env: SWIFT_VERSION=4.2.4
|
||
os: linux
|
||
name: Linux / Swift 4.2.4
|
||
language: generic
|
||
sudo: false
|
||
install: eval "$(curl -sL https://swiftenv.fuller.li/install.sh)"
|
||
before_script: swift build -Xswiftc -warnings-as-errors
|
||
script: swift test --parallel
|
||
|
||
- <<: *linux
|
||
env: SWIFT_VERSION=5.0.3
|
||
name: Linux / Swift 5.0.3
|
||
|
||
- <<: *linux
|
||
env: SWIFT_VERSION=5.1.3
|
||
name: Linux / Swift 5.1.3
|
||
|
||
- <<: *linux
|
||
env: SWIFT_VERSION=5.2-DEVELOPMENT-SNAPSHOT-2020-01-22-a
|
||
name: Linux / Swift 5.2.0-dev+2020-01-22-a
|
||
|
||
- stage: pretest
|
||
name: Check Linux tests are sync’d
|
||
install: swift test --generate-linuxmain
|
||
script: git diff --exit-code
|
||
osx_image: xcode10.2
|
||
|
||
- stage: deploy
|
||
name: Deploy
|
||
osx_image: xcode11
|
||
env: HOMEBREW_NO_INSTALL_CLEANUP=1
|
||
install: brew install mxcl/made/swift-sh
|
||
script:
|
||
- set -e
|
||
- export VERSION=$(echo $TRAVIS_TAG | cut -c 8-)
|
||
- git tag "$VERSION"
|
||
- git remote set-url origin "https://$GITHUB_TOKEN@github.com/$TRAVIS_REPO_SLUG.git"
|
||
- git fetch --unshallow origin
|
||
- git push origin "$VERSION"
|
||
- swift sh <(curl https://raw.githubusercontent.com/mxcl/ops/master/deploy) publish-release
|
||
- git push origin :$TRAVIS_TAG
|
||
|
||
- stage: publish
|
||
name: Jazzy
|
||
osx_image: xcode10.2
|
||
install: gem install jazzy
|
||
before_script: swift package generate-xcodeproj
|
||
script: |
|
||
jazzy --config .github/jazzy.yml \
|
||
--module-version $TRAVIS_TAG \
|
||
--github_url "https://github.com/$TRAVIS_REPO_SLUG"
|
||
deploy:
|
||
provider: pages
|
||
skip-cleanup: true
|
||
github-token: $GITHUB_TOKEN
|
||
local-dir: output
|
||
on:
|
||
tags: true
|
||
|
||
- name: CocoaPods
|
||
osx_image: xcode10.2
|
||
install: |
|
||
brew install mxcl/made/swift-sh
|
||
curl -O https://raw.githubusercontent.com/mxcl/ops/master/deploy
|
||
chmod u+x deploy
|
||
before_script: ./deploy generate-podspec
|
||
script: pod trunk push
|
||
after_success: ./deploy publish-release
|