Skip to content

chore: Refactor Travis to use build matrix #103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 36 additions & 39 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,41 @@
os:
- osx
- linux
osx_image: xcode9
language: generic
sudo: required
dist: trusty
env:
global:
- SWIFT_VERSION=4.0
matrix:
- SWIFTPM_BUILD=true
- SWIFTPM_TEST=true
- XCODE_TEST_SDK=macosx
- XCODE_BUILD_SDK=iphonesimulator
- XCODE_BUILD_SDK=appletvsimulator
- XCODE_BUILD_SDK=watchsimulator

matrix:
exclude:
# No need to build and test on macOS
- os: osx
env: SWIFTPM_BUILD=true
# LinuxMain.swift is out of sync
- os: linux
env: SWIFTPM_TEST=true
- os: linux
env: XCODE_TEST_SDK=macosx
- os: linux
env: XCODE_BUILD_SDK=iphonesimulator
- os: linux
env: XCODE_BUILD_SDK=appletvsimulator
- os: linux
env: XCODE_BUILD_SDK=watchsimulator
install: eval "$(curl -sL https://swiftenv.fuller.li/install.sh)"

install:
- eval "$(curl -sL https://swiftenv.fuller.li/install.sh)"

script:
- if [ -n "$SWIFTPM_BUILD" ]; then swift build; fi
- if [ -n "$SWIFTPM_TEST" ]; then swift test; fi
- if [ -n "$XCODE_BUILD_SDK" ] || [ -n "$XCODE_TEST_SDK" ]; then swift package generate-xcodeproj; fi
- if [ -n "$XCODE_BUILD_SDK" ]; then xcodebuild -project JWT.xcodeproj -scheme JWT-Package build -sdk $XCODE_BUILD_SDK; fi
- if [ -n "$XCODE_TEST_SDK" ]; then xcodebuild -project JWT.xcodeproj -scheme JWT-Package test -sdk $XCODE_TEST_SDK; fi
jobs:
include:
- stage: test
os: linux
language: generic
dist: trusty
sudo: required
script: swift build
- stage: test
os: osx
osx_image: xcode9
script: swift test
- stage: test
os: osx
osx_image: xcode9
script:
- swift package generate-xcodeproj
- xcodebuild -project JWT.xcodeproj -scheme JWT-Package build -sdk macosx
- stage: test
os: osx
osx_image: xcode9
script:
- swift package generate-xcodeproj
- xcodebuild -project JWT.xcodeproj -scheme JWT-Package build -sdk iphonesimulator
- stage: test
os: osx
osx_image: xcode9
script: swift package generate-xcodeproj
- xcodebuild -project JWT.xcodeproj -scheme JWT-Package build -sdk appletvsimulator
- stage: test
os: osx
osx_image: xcode9
script:
- swift package generate-xcodeproj
- xcodebuild -project JWT.xcodeproj -scheme JWT-Package test -sdk watchsimulator