|
| 1 | +name: Run CI |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: [ main ] |
| 5 | + paths-ignore: |
| 6 | + - '**.md' # Do not need to run CI for markdown changes. |
| 7 | + pull_request: |
| 8 | + branches: [ main ] |
| 9 | + paths-ignore: |
| 10 | + - '**.md' |
| 11 | + |
| 12 | +jobs: |
| 13 | + macos-build: |
| 14 | + runs-on: macos-latest |
| 15 | + |
| 16 | + strategy: |
| 17 | + matrix: |
| 18 | + include: |
| 19 | + - xcode-version: 15.0.0 |
| 20 | + ios-sim: 'platform=iOS Simulator,name=iPhone 15,OS=17.0.1' |
| 21 | + - xcode-version: 14.0.1 |
| 22 | + ios-sim: 'platform=iOS Simulator,name=iPhone 14,OS=16.0' |
| 23 | + - xcode-version: 13.4.1 |
| 24 | + ios-sim: 'platform=iOS Simulator,name=iPhone 11,OS=15.5' |
| 25 | + |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@v4 |
| 28 | + with: |
| 29 | + fetch-depth: 0 # If you only need the current version keep this. |
| 30 | + |
| 31 | + - uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd |
| 32 | + if: ${{ matrix.xcode-version != '15.0.0' }} |
| 33 | + with: |
| 34 | + xcode-version: ${{ matrix.xcode-version }} |
| 35 | + |
| 36 | + - name: Build & Test on macOS Simulator |
| 37 | + run: xcodebuild test -scheme 'LDSwiftEventSource' -sdk macosx -destination 'platform=macOS' | xcpretty |
| 38 | + |
| 39 | + - name: Build for ARM64 macOS |
| 40 | + run: xcodebuild build -scheme 'LDSwiftEventSource' -arch arm64e -sdk macosx | xcpretty |
| 41 | + |
| 42 | + - name: Build Tests for iOS device |
| 43 | + run: xcodebuild build-for-testing -scheme 'LDSwiftEventSource' -sdk iphoneos CODE_SIGN_IDENTITY= | xcpretty |
| 44 | + |
| 45 | + - name: Build & Test on iOS Simulator |
| 46 | + run: xcodebuild test -scheme 'LDSwiftEventSource' -sdk iphonesimulator -destination '${{ matrix.ios-sim }}' CODE_SIGN_IDENTITY= | xcpretty |
| 47 | + |
| 48 | + - name: Build Tests for tvOS device |
| 49 | + run: xcodebuild build-for-testing -scheme 'LDSwiftEventSource' -sdk appletvos CODE_SIGN_IDENTITY= | xcpretty |
| 50 | + |
| 51 | + - name: Build & Test on tvOS Simulator |
| 52 | + run: xcodebuild test -scheme 'LDSwiftEventSource' -sdk appletvsimulator -destination 'platform=tvOS Simulator,name=Apple TV' | xcpretty |
| 53 | + |
| 54 | + - name: Build for watchOS simulator # No XCTest testing on watchOS |
| 55 | + run: xcodebuild build -scheme 'LDSwiftEventSource' -sdk watchsimulator | xcpretty |
| 56 | + |
| 57 | + - name: Build for watchOS device # No XCTest testing on watchOS |
| 58 | + run: xcodebuild build -scheme 'LDSwiftEventSource' -sdk watchos | xcpretty |
| 59 | + |
| 60 | + - name: Build & Test with swiftpm |
| 61 | + run: swift test -v 2>&1 | xcpretty |
| 62 | + |
| 63 | + - name: Run contract tests |
| 64 | + run: make contract-tests |
| 65 | + |
| 66 | + - name: Install jazzy gem |
| 67 | + run: | |
| 68 | + gem install jazzy |
| 69 | + gem cleanup |
| 70 | +
|
| 71 | + - name: Build Documentation |
| 72 | + run: jazzy -o artifacts/docs |
| 73 | + |
| 74 | + - name: Validate coverage |
| 75 | + run: | |
| 76 | + FULLDOC=`jq '.warnings | length == 0' artifacts/docs/undocumented.json` |
| 77 | + [ $FULLDOC == "true" ] |
| 78 | +
|
| 79 | +
|
| 80 | + linux-build: |
| 81 | + runs-on: ubuntu-latest |
| 82 | + |
| 83 | + strategy: |
| 84 | + matrix: |
| 85 | + swift-version: |
| 86 | + - 5.1 |
| 87 | + - 5.2 |
| 88 | + - 5.3 |
| 89 | + - 5.4 |
| 90 | + - 5.5 |
| 91 | + - 5.6 |
| 92 | + - 5.7 |
| 93 | + - 5.8 |
| 94 | + - 5.9 |
| 95 | + |
| 96 | + container: swift:${{ matrix.swift-version }} |
| 97 | + |
| 98 | + steps: |
| 99 | + - uses: actions/checkout@v3 |
| 100 | + with: |
| 101 | + fetch-depth: 0 # If you only need the current version keep this. |
| 102 | + |
| 103 | + - name: Build and test |
| 104 | + run: swift test --enable-test-discovery |
| 105 | + |
| 106 | + windows-build: |
| 107 | + name: Windows - Swift 5.9 |
| 108 | + runs-on: windows-latest |
| 109 | + steps: |
| 110 | + - uses: actions/checkout@v3 |
| 111 | + - name: Install Swift |
| 112 | + uses: compnerd/gha-setup-swift@cd348eb89f2f450b0664c07fb1cb66880addf17d |
| 113 | + with: |
| 114 | + branch: swift-5.9-release |
| 115 | + tag: 5.9-RELEASE |
| 116 | + - name: Build and test |
| 117 | + run: swift test |
0 commit comments