Use GHA instead of Travis where possible

This commit is contained in:
Max Howell
2020-07-26 12:26:39 -04:00
parent 6e99825d9f
commit baa6416208
3 changed files with 82 additions and 79 deletions

77
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,77 @@
name: CI
on: [pull_request]
jobs:
smoke:
runs-on: macos-latest
steps:
- uses: technote-space/auto-cancel-redundant-job@v1
- uses: actions/checkout@v2
- run: swift test --generate-linuxmain
- run: git diff --exit-code
macOS:
needs: smoke
runs-on: macos-latest
strategy:
matrix:
xcode:
#- 10.3 # Swift 5.0 (doesnt work on GHA macOS image :-/)
- 11.3 # Swift 5.1
- ^11.4 # Swift 5.2
- latest # Swift 5.3
steps:
- uses: actions/checkout@v2
- name: setup-xcode
uses: maxim-lobanov/setup-xcode@1.0
with:
xcode-version: ${{ matrix.xcode }}
- run: swift --version
- run: swift test --parallel
otherOS:
needs: smoke
runs-on: macos-latest
strategy:
matrix:
destination:
- platform=iOS Simulator,OS=latest,name=iPhone 11
- platform=tvOS Simulator,OS=latest,name=Apple TV
- platform=macOS # for code-coverage
steps:
- uses: actions/checkout@v2
- run: swift package generate-xcodeproj --enable-code-coverage
- uses: sersoft-gmbh/xcodebuild-action@v1
with:
project: Path.swift.xcodeproj
scheme: Path.swift-Package
destination: ${{ matrix.destination }}
action: test
- uses: codecov/codecov-action@v1
watchOS:
needs: smoke
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- run: swift package generate-xcodeproj --enable-code-coverage
- uses: sersoft-gmbh/xcodebuild-action@v1
with:
project: Path.swift.xcodeproj
scheme: Path.swift-Package
destination: platform=watchOS Simulator,OS=latest,name=Apple Watch Series 5 - 40mm
action: build
linux:
needs: smoke
runs-on: ubuntu-latest
strategy:
matrix:
swift:
# - 4.0.3 fails for some reason
- 4.2
- 5.0.3
- 5.1
- 5.2
# - 5.3 not available yet sigh
steps:
- uses: actions/checkout@v2
- uses: fwal/setup-swift@v1
with:
swift-version: ${{ matrix.swift }}
- run: swift test --parallel

View File

@@ -1,90 +1,16 @@
# 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+(-.*)?$/
# Travis does CD, GHA does CI
if: 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 syncd
install: swift test --generate-linuxmain
script: git diff --exit-code
osx_image: xcode10.2
- stage: deploy
name: Deploy
osx_image: xcode11
@@ -105,7 +31,7 @@ jobs:
- stage: publish
name: Jazzy
osx_image: xcode10.2
osx_image: xcode11
install: gem install jazzy
before_script: swift package generate-xcodeproj
script: |
@@ -121,8 +47,8 @@ jobs:
tags: true
- name: CocoaPods
osx_image: xcode10.2
env: HOMEBREW_NO_INSTALL_CLEANUP=1
osx_image: xcode11
install:
- brew install mxcl/made/swift-sh
- curl -O https://raw.githubusercontent.com/mxcl/ops/master/deploy

View File

@@ -430,7 +430,7 @@ Carthage:
[badge-platforms]: https://img.shields.io/badge/platforms-macOS%20%7C%20Linux%20%7C%20iOS%20%7C%20tvOS%20%7C%20watchOS-lightgrey.svg
[badge-languages]: https://img.shields.io/badge/swift-4.2%20%7C%205.0%20%7C%205.1%20%7C%205.2-orange.svg
[badge-languages]: https://img.shields.io/badge/swift-4.2%20%7C%205.0%20%7C%205.1%20%7C%205.2%20%7C%205.3-orange.svg
[docs]: https://mxcl.dev/Path.swift/Structs/Path.html
[badge-jazzy]: https://raw.githubusercontent.com/mxcl/Path.swift/gh-pages/badge.svg?sanitize=true
[badge-codecov]: https://codecov.io/gh/mxcl/Path.swift/branch/master/graph/badge.svg