Fix Int overflow on 32-bit platforms (wasm32, armv7)
#2075
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: [main, dev] | |
| paths-ignore: | |
| - 'Docs/**' # Docs folder in root of repo | |
| - '**/*.md' # .md files anywhere in the repo | |
| - '**/LICENSE' # LICENSE files anywhere in the repo | |
| - '**/.gitignore' # .gitignore files anywhere in the repo | |
| pull_request: | |
| branches: [main] | |
| paths-ignore: | |
| - 'Docs/**' # Docs folder in root of repo | |
| - '**/*.md' # .md files anywhere in the repo | |
| - '**/LICENSE' # LICENSE files anywhere in the repo | |
| - '**/.gitignore' # .gitignore files anywhere in the repo | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '40 11 * * *' # once a day @ 11:40am UTC (4:40am PST) | |
| env: | |
| SCHEME: swift-timecode | |
| WORKSPACEPATH: .swiftpm/xcode/package.xcworkspace | |
| jobs: | |
| macOS: | |
| name: Tests (macOS) | |
| runs-on: macos-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@main | |
| - uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: latest-stable | |
| - name: Build | |
| run: xcodebuild build -skipMacroValidation -workspace "$WORKSPACEPATH" -scheme "$SCHEME" -destination "generic/platform=macOS" | xcbeautify --renderer github-actions && exit ${PIPESTATUS[0]} | |
| - name: Unit Tests | |
| run: xcodebuild test -skipMacroValidation -workspace "$WORKSPACEPATH" -scheme "$SCHEME" -destination "platform=macOS" | xcbeautify --renderer github-actions && exit ${PIPESTATUS[0]} | |
| macOS-swift6-2: | |
| name: Tests (macOS - Swift 6.2) | |
| runs-on: macos-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@main | |
| - uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: latest-stable | |
| - name: Set Package to Swift 6.2 | |
| run: swift package tools-version --set "6.2" | |
| - name: Build | |
| run: xcodebuild build -skipMacroValidation -workspace "$WORKSPACEPATH" -scheme "$SCHEME" -destination "generic/platform=macOS" | xcbeautify --renderer github-actions && exit ${PIPESTATUS[0]} | |
| - name: Unit Tests | |
| run: xcodebuild test -skipMacroValidation -workspace "$WORKSPACEPATH" -scheme "$SCHEME" -destination "platform=macOS" | xcbeautify --renderer github-actions && exit ${PIPESTATUS[0]} | |
| macCatalyst: | |
| name: Tests (macCatalyst) | |
| runs-on: macos-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@main | |
| - uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: latest-stable | |
| - name: Build | |
| run: xcodebuild build -skipMacroValidation -workspace "$WORKSPACEPATH" -scheme "$SCHEME" -destination "generic/platform=macOS,variant=Mac Catalyst" | xcbeautify --renderer github-actions && exit ${PIPESTATUS[0]} | |
| - name: Unit Tests | |
| run: xcodebuild test -skipMacroValidation -workspace "$WORKSPACEPATH" -scheme "$SCHEME" -destination "platform=macOS,variant=Mac Catalyst" | xcbeautify --renderer github-actions && exit ${PIPESTATUS[0]} | |
| device-simulators: | |
| name: Tests | |
| runs-on: macos-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: [iOS, tvOS, watchOS, visionOS] | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@main | |
| - uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: latest-stable | |
| - name: Prepare Device Simulator | |
| id: sim-setup | |
| uses: orchetect/setup-xcode-simulator@v1 | |
| with: | |
| refresh: true | |
| download: true | |
| scheme: ${{ env.SCHEME }} | |
| target: ${{ matrix.target }} | |
| - name: Build | |
| run: xcodebuild build -skipMacroValidation -workspace "$WORKSPACEPATH" -scheme "$SCHEME" -destination "generic/platform=$PLATFORMSHORT" | xcbeautify --renderer github-actions && exit ${PIPESTATUS[0]} | |
| env: | |
| PLATFORMSHORT: ${{ steps.sim-setup.outputs.platform-short }} | |
| WORKSPACEPATH: ${{ steps.sim-setup.outputs.workspace-path }} | |
| - name: Unit Tests | |
| run: xcodebuild test -skipMacroValidation -workspace "$WORKSPACEPATH" -scheme "$SCHEME" -destination "platform=$PLATFORM,id=$ID" | xcbeautify --renderer github-actions && exit ${PIPESTATUS[0]} | |
| env: | |
| ID: ${{ steps.sim-setup.outputs.id }} | |
| PLATFORM: ${{ steps.sim-setup.outputs.platform }} | |
| WORKSPACEPATH: ${{ steps.sim-setup.outputs.workspace-path }} | |
| linux: | |
| name: Tests (Linux) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@main | |
| - name: Build | |
| run: swift build | |
| - name: Unit Tests | |
| run: swift test | |
| android: | |
| name: Build (Android) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| env: | |
| TARGET_TRIPLE: aarch64-unknown-linux-android28 | |
| steps: | |
| - uses: actions/checkout@main | |
| - uses: orchetect/setup-swift-android-sdk@v1 | |
| with: | |
| target-triple: ${{ env.TARGET_TRIPLE }} | |
| - name: Build | |
| run: swift build --swift-sdk "$TARGET_TRIPLE" --static-swift-stdlib | |
| wasm-on-linux: | |
| name: Build (WASM on Linux) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| env: | |
| TARGET_TRIPLE: wasm32-unknown-wasip1 | |
| steps: | |
| - uses: actions/checkout@main | |
| - name: Prepare SDK | |
| uses: orchetect/setup-swift-wasm-sdk@v1 | |
| id: sdk-setup | |
| with: | |
| target-triple: ${{ env.TARGET_TRIPLE }} | |
| - name: Build | |
| run: swift build --swift-sdk "$SDK_ID" --triple "$TARGET_TRIPLE" | |
| env: | |
| SDK_ID: ${{ steps.sdk-setup.outputs.id }} | |
| wasm-on-macos: | |
| name: Build (WASM on macOS) | |
| runs-on: macos-latest | |
| timeout-minutes: 30 | |
| env: | |
| TARGET_TRIPLE: wasm32-unknown-wasip1 | |
| steps: | |
| - uses: actions/checkout@main | |
| # Note: The Swift toolchain that ships with Xcode (which is the default Swift toolchain on macOS GitHub runners) | |
| # has a bug that causes the build to crash. The workaround is to use a standalone Swift toolchain. | |
| - name: Install swiftly and latest Swift toolchain | |
| uses: swift-actions/setup-swift@v3 | |
| - name: Prepare SDK | |
| uses: orchetect/setup-swift-wasm-sdk@v1 | |
| id: sdk-setup | |
| with: | |
| target-triple: ${{ env.TARGET_TRIPLE }} | |
| - name: Build | |
| run: swift build --swift-sdk "$SDK_ID" --triple "$TARGET_TRIPLE" | |
| env: | |
| SDK_ID: ${{ steps.sdk-setup.outputs.id }} |