|
| 1 | +name: Checks |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + pull_request: |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: read |
| 10 | + |
| 11 | +concurrency: |
| 12 | + group: checks-${{ github.workflow }}-${{ github.ref }} |
| 13 | + cancel-in-progress: true |
| 14 | + |
| 15 | +jobs: |
| 16 | + swift: |
| 17 | + name: Swift 6.2.1 |
| 18 | + runs-on: macos-15 |
| 19 | + timeout-minutes: 30 |
| 20 | + steps: |
| 21 | + - name: Check out repository |
| 22 | + uses: actions/checkout@v7 |
| 23 | + |
| 24 | + - name: Set up Xcode |
| 25 | + uses: maxim-lobanov/setup-xcode@v1 |
| 26 | + with: |
| 27 | + xcode-version: "16.2" |
| 28 | + |
| 29 | + - name: Set up Swift |
| 30 | + uses: swift-actions/setup-swift@v2.4.0 |
| 31 | + with: |
| 32 | + swift-version: "6.2.1" |
| 33 | + |
| 34 | + - name: Show toolchain versions |
| 35 | + run: | |
| 36 | + swift --version |
| 37 | + xcodebuild -version |
| 38 | +
|
| 39 | + - name: Build |
| 40 | + run: swift build |
| 41 | + |
| 42 | + - name: Check Swift 6 concurrency |
| 43 | + run: make strict-concurrency |
| 44 | + |
| 45 | + - name: Test |
| 46 | + run: swift test |
| 47 | + |
| 48 | + - name: Release build |
| 49 | + run: swift build -c release |
| 50 | + |
| 51 | + - name: Test with Thread Sanitizer |
| 52 | + env: |
| 53 | + MACOSX_DEPLOYMENT_TARGET: "13.0" |
| 54 | + run: swift test --sanitize=thread |
| 55 | + |
| 56 | + apple-platforms: |
| 57 | + name: ${{ matrix.name }} compile check |
| 58 | + runs-on: macos-15 |
| 59 | + timeout-minutes: 20 |
| 60 | + strategy: |
| 61 | + fail-fast: false |
| 62 | + matrix: |
| 63 | + include: |
| 64 | + - name: iOS |
| 65 | + sdk: iphonesimulator |
| 66 | + triple: arm64-apple-ios13.0-simulator |
| 67 | + - name: tvOS |
| 68 | + sdk: appletvsimulator |
| 69 | + triple: arm64-apple-tvos13.0-simulator |
| 70 | + - name: watchOS |
| 71 | + sdk: watchsimulator |
| 72 | + triple: arm64-apple-watchos6.0-simulator |
| 73 | + - name: visionOS |
| 74 | + sdk: xrsimulator |
| 75 | + triple: arm64-apple-xros1.0-simulator |
| 76 | + steps: |
| 77 | + - name: Check out repository |
| 78 | + uses: actions/checkout@v7 |
| 79 | + |
| 80 | + - name: Set up Xcode |
| 81 | + uses: maxim-lobanov/setup-xcode@v1 |
| 82 | + with: |
| 83 | + xcode-version: "16.2" |
| 84 | + |
| 85 | + - name: Set up Swift |
| 86 | + uses: swift-actions/setup-swift@v2.4.0 |
| 87 | + with: |
| 88 | + swift-version: "6.2.1" |
| 89 | + |
| 90 | + - name: Show toolchain versions |
| 91 | + run: | |
| 92 | + swift --version |
| 93 | + xcodebuild -version |
| 94 | +
|
| 95 | + - name: Compile public libraries |
| 96 | + run: | |
| 97 | + for target in Messagevisor MessagevisorICU MessagevisorInterpolation MessagevisorMissingTranslations; do |
| 98 | + swift build \ |
| 99 | + --target "$target" \ |
| 100 | + --triple "${{ matrix.triple }}" \ |
| 101 | + --sdk "$(xcrun --sdk '${{ matrix.sdk }}' --show-sdk-path)" \ |
| 102 | + --scratch-path "/tmp/messagevisor-${{ matrix.sdk }}-$target" |
| 103 | + done |
| 104 | +
|
| 105 | + integration: |
| 106 | + name: Public consumers and project-1 |
| 107 | + runs-on: macos-15 |
| 108 | + timeout-minutes: 30 |
| 109 | + steps: |
| 110 | + - name: Check out Swift SDK |
| 111 | + uses: actions/checkout@v7 |
| 112 | + |
| 113 | + - name: Set up Xcode |
| 114 | + uses: maxim-lobanov/setup-xcode@v1 |
| 115 | + with: |
| 116 | + xcode-version: "16.2" |
| 117 | + |
| 118 | + - name: Set up Swift |
| 119 | + uses: swift-actions/setup-swift@v2.4.0 |
| 120 | + with: |
| 121 | + swift-version: "6.2.1" |
| 122 | + |
| 123 | + - name: Set up Node.js |
| 124 | + uses: actions/setup-node@v7 |
| 125 | + with: |
| 126 | + node-version-file: .nvmrc |
| 127 | + package-manager-cache: false |
| 128 | + |
| 129 | + - name: Initialize Messagevisor project-1 |
| 130 | + env: |
| 131 | + npm_config_yes: "true" |
| 132 | + run: | |
| 133 | + mkdir project-1 |
| 134 | + cd project-1 |
| 135 | + npx @messagevisor/cli init --project=1 |
| 136 | +
|
| 137 | + - name: Install Messagevisor project-1 dependencies |
| 138 | + working-directory: project-1 |
| 139 | + run: npm install |
| 140 | + |
| 141 | + - name: Validate Messagevisor project-1 |
| 142 | + working-directory: project-1 |
| 143 | + run: | |
| 144 | + npm run lint |
| 145 | + npm run build |
| 146 | + npm run test |
| 147 | +
|
| 148 | + - name: Verify clean package consumers |
| 149 | + run: make verify-consumers |
| 150 | + |
| 151 | + - name: Run project tests against Swift SDK |
| 152 | + run: >- |
| 153 | + swift run messagevisor-swift test --projectDirectoryPath=project-1 |
| 154 | + --onlyFailures --target=swift --normalizeSpaces --withIcuModule |
| 155 | + --withInterpolationModule |
0 commit comments