diff --git a/.github/workflows/swift-arm.yml b/.github/workflows/swift-arm.yml index 410cd7f49..4508479ea 100644 --- a/.github/workflows/swift-arm.yml +++ b/.github/workflows/swift-arm.yml @@ -6,6 +6,9 @@ jobs: name: Baremetal Embedded ARM runs-on: ubuntu-latest container: swiftlang/swift:nightly-jammy + strategy: + matrix: + target: ["Bluetooth", "BluetoothGAP"] steps: - name: Install dependencies run: apt update -y; apt install libtool-bin -y; @@ -14,14 +17,73 @@ jobs: - name: Swift Version run: swift --version - name: Build Bluetooth - run: SWIFTPM_ENABLE_MACROS=0 SWIFTPM_ENABLE_PLUGINS=0 SWIFTPM_BLUETOOTH_METADATA=0 swift build --triple armv6m-apple-none-macho --configuration release --verbose -Xswiftc -enable-experimental-feature -Xswiftc Embedded -Xswiftc -disable-stack-protector -Xcc -D__MACH__ -Xcc -ffreestanding -Xcc -mcpu=cortex-m0plus -Xcc -mthumb --target Bluetooth - - name: Build BluetoothGAP - run: SWIFTPM_ENABLE_MACROS=0 SWIFTPM_ENABLE_PLUGINS=0 SWIFTPM_BLUETOOTH_METADATA=0 swift build --triple armv6m-apple-none-macho --configuration release --verbose -Xswiftc -enable-experimental-feature -Xswiftc Embedded -Xswiftc -disable-stack-protector -Xcc -D__MACH__ -Xcc -ffreestanding -Xcc -mcpu=cortex-m0plus -Xcc -mthumb --target BluetoothGAP + run: SWIFTPM_ENABLE_MACROS=0 SWIFTPM_ENABLE_PLUGINS=0 SWIFTPM_BLUETOOTH_METADATA=0 SWIFT_BLUETOOTH_C_SHIMS=0 swift build --triple armv6m-apple-none-macho --configuration release --verbose -Xswiftc -enable-experimental-feature -Xswiftc Embedded -Xcc -D__MACH__ -Xcc -ffreestanding -Xcc -mcpu=cortex-m0plus -Xcc -mthumb --target ${{ matrix.target }} + + linux-arm-raspios-build: + name: Linux (Build) + runs-on: ubuntu-latest + strategy: + matrix: + config: ["debug" , "release"] + swift: ["6.1.2"] + linux: ["raspios"] + release: ["bookworm"] + arch: ["armv6", "armv7"] + container: swift:${{ matrix.swift }} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install dependencies + run: apt update -y; apt install wget -y + - name: Install SDK + run: | + wget https://github.com/xtremekforever/swift-armv7/releases/download/${{ matrix.swift }}/swift-${{ matrix.swift }}-RELEASE-${{ matrix.linux }}-${{ matrix.release }}-${{ matrix.arch }}-sdk.tar.gz + tar -xvf swift-${{ matrix.swift }}-RELEASE-${{ matrix.linux }}-${{ matrix.release }}-${{ matrix.arch }}-sdk.tar.gz + mv swift-${{ matrix.swift }}-RELEASE-${{ matrix.linux }}-${{ matrix.release }}-${{ matrix.arch }} /opt/swift-${{ matrix.swift }}-RELEASE-${{ matrix.linux }}-${{ matrix.release }}-${{ matrix.arch }} + - name: Swift Version + run: swift --version + - name: Build + run: SWIFT_BUILD_DYNAMIC_LIBRARY=1 swift build -c ${{ matrix.config }} --destination /opt/swift-${{ matrix.swift }}-RELEASE-${{ matrix.linux }}-${{ matrix.release }}-${{ matrix.arch }}/${{ matrix.linux }}-${{ matrix.release }}.json + + linux-arm-debian-build: + name: Linux (Build) + runs-on: ubuntu-latest + strategy: + matrix: + config: ["debug" , "release"] + swift: ["6.1.2"] + linux: ["debian"] + release: ["bookworm", "bullseye"] + arch: ["armv7"] + container: swift:${{ matrix.swift }} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install dependencies + run: apt update -y; apt install wget -y + - name: Install SDK + run: | + wget https://github.com/xtremekforever/swift-armv7/releases/download/${{ matrix.swift }}/swift-${{ matrix.swift }}-RELEASE-${{ matrix.linux }}-${{ matrix.release }}-${{ matrix.arch }}-sdk.tar.gz + tar -xvf swift-${{ matrix.swift }}-RELEASE-${{ matrix.linux }}-${{ matrix.release }}-${{ matrix.arch }}-sdk.tar.gz + mv swift-${{ matrix.swift }}-RELEASE-${{ matrix.linux }}-${{ matrix.release }}-${{ matrix.arch }} /opt/swift-${{ matrix.swift }}-RELEASE-${{ matrix.linux }}-${{ matrix.release }}-${{ matrix.arch }} + - name: Swift Version + run: swift --version + - name: Build + run: SWIFT_BUILD_DYNAMIC_LIBRARY=1 swift build -c ${{ matrix.config }} --destination /opt/swift-${{ matrix.swift }}-RELEASE-${{ matrix.linux }}-${{ matrix.release }}-${{ matrix.arch }}/${{ matrix.linux }}-${{ matrix.release }}.json + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: "swift-${{ matrix.swift }}-RELEASE-${{ matrix.linux }}-${{ matrix.release }}-${{ matrix.arch }}-bluetooth-${{ matrix.config }}" + path: .build/armv7-unknown-linux-gnueabihf/${{ matrix.config }}/libBluetooth.so + - armv7-bookworm: - name: Armv7 Debian Bookworm + linux-arm-test: + name: Linux (Test) runs-on: ubuntu-latest - container: swift:6.0.3 + strategy: + matrix: + swift: ["6.0.3"] + container: swift:${{ matrix.swift }} steps: - name: Checkout uses: actions/checkout@v4 @@ -29,15 +91,15 @@ jobs: run: apt update -y; apt install wget -y - name: Install SDK run: | - wget https://github.com/xtremekforever/swift-armv7/releases/download/6.0.3/swift-6.0.3-RELEASE-debian-bookworm-armv7-sdk.tar.gz - tar -xvf swift-6.0.3-RELEASE-debian-bookworm-armv7-sdk.tar.gz - mv swift-6.0.3-RELEASE-debian-bookworm-armv7 /opt/swift-6.0.3-RELEASE-debian-bookworm-armv7 + wget https://github.com/xtremekforever/swift-armv7/releases/download/${{ matrix.swift }}/swift-${{ matrix.swift }}-RELEASE-debian-bookworm-armv7-sdk.tar.gz + tar -xvf swift-${{ matrix.swift }}-RELEASE-debian-bookworm-armv7-sdk.tar.gz + mv swift-${{ matrix.swift }}-RELEASE-debian-bookworm-armv7 /opt/swift-${{ matrix.swift }}-RELEASE-debian-bookworm-armv7 - name: Swift Version run: swift --version - name: Build - run: swift build --build-tests --destination /opt/swift-6.0.3-RELEASE-debian-bookworm-armv7/debian-bookworm.json + run: SWIFT_BUILD_DYNAMIC_LIBRARY=0 swift build --build-tests --destination /opt/swift-${{ matrix.swift }}-RELEASE-debian-bookworm-armv7/debian-bookworm.json - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: "armv7-bookworm" + name: "linux-armv7-bookworm-tests-${{ matrix.swift }}" path: .build/armv7-unknown-linux-gnueabihf/debug/BluetoothPackageTests.xctest diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 6dbf69549..a4c747009 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -5,23 +5,27 @@ jobs: macos: name: macOS runs-on: macos-15 + strategy: + matrix: + config: ["debug", "release"] + options: ["", "SWIFT_BUILD_DYNAMIC_LIBRARY=1", "SWIFT_BLUETOOTH_C_SHIMS=1"] steps: - name: Checkout uses: actions/checkout@v4 - name: Swift Version run: swift --version - - name: Build (Debug) - run: swift build -c debug - - name: Build (Release) - run: swift build -c release - - name: Test (Debug) - run: swift test -c debug + - name: Build + run: ${{ matrix.options }} swift build -c ${{ matrix.config }} + - name: Test + run: ${{ matrix.options }} swift test -c ${{ matrix.config }} linux: name: Linux strategy: matrix: - container: ["swift:6.0.3", "swift:6.1.1", "swiftlang/swift:nightly"] + container: ["swift:6.0.3", "swift:6.1.1"] + config: ["debug", "release"] + options: ["", "SWIFT_BUILD_DYNAMIC_LIBRARY=1", "SWIFT_BLUETOOTH_C_SHIMS=1"] runs-on: ubuntu-latest container: ${{ matrix.container }}-jammy steps: @@ -29,27 +33,24 @@ jobs: uses: actions/checkout@v4 - name: Swift Version run: swift --version - - name: Build (Debug) - run: swift build -c debug - - name: Build (Release) - run: swift build -c release - - name: Test (Debug) - run: swift test -c debug + - name: Build + run: ${{ matrix.options }} swift build -c ${{ matrix.config }} + - name: Test + run: ${{ matrix.options }} swift test -c ${{ matrix.config }} - android: - name: Android - strategy: - fail-fast: false - matrix: - swift: ['6.1', 'nightly-6.2'] - arch: ['x86_64'] - runs-on: macos-15 - timeout-minutes: 30 - steps: - - uses: actions/checkout@v4 - - name: "Build Swift Package for Android" - run: | - brew install skiptools/skip/skip || (brew update && brew install skiptools/skip/skip) - skip android sdk install --version ${{ matrix.swift }} - # https://github.com/swiftlang/swift-driver/pull/1879 - ANDROID_NDK_ROOT="" skip android build \ No newline at end of file + android-arm: + name: Android + strategy: + fail-fast: false + matrix: + swift: ['6.1', 'nightly-6.2'] + arch: ["aarch64", "x86_64"] + runs-on: macos-15 + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + - name: "Build Swift Package for Android" + run: | + brew install skiptools/skip/skip || (brew update && brew install skiptools/skip/skip) + skip android sdk install --version ${{ matrix.swift }} + ANDROID_NDK_ROOT="" SWIFT_BLUETOOTH_C_SHIMS=0 skip android build --arch ${{ matrix.arch }} \ No newline at end of file