Skip to content

Commit 7f9d7d4

Browse files
authored
Update GitHub CI (#193)
1 parent 1d84391 commit 7f9d7d4

File tree

2 files changed

+104
-41
lines changed

2 files changed

+104
-41
lines changed

.github/workflows/swift-arm.yml

Lines changed: 73 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ jobs:
66
name: Baremetal Embedded ARM
77
runs-on: ubuntu-latest
88
container: swiftlang/swift:nightly-jammy
9+
strategy:
10+
matrix:
11+
target: ["Bluetooth", "BluetoothGAP"]
912
steps:
1013
- name: Install dependencies
1114
run: apt update -y; apt install libtool-bin -y;
@@ -14,30 +17,89 @@ jobs:
1417
- name: Swift Version
1518
run: swift --version
1619
- name: Build Bluetooth
17-
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
18-
- name: Build BluetoothGAP
19-
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
20+
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 }}
21+
22+
linux-arm-raspios-build:
23+
name: Linux (Build)
24+
runs-on: ubuntu-latest
25+
strategy:
26+
matrix:
27+
config: ["debug" , "release"]
28+
swift: ["6.1.2"]
29+
linux: ["raspios"]
30+
release: ["bookworm"]
31+
arch: ["armv6", "armv7"]
32+
container: swift:${{ matrix.swift }}
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v4
36+
- name: Install dependencies
37+
run: apt update -y; apt install wget -y
38+
- name: Install SDK
39+
run: |
40+
wget https://github.com/xtremekforever/swift-armv7/releases/download/${{ matrix.swift }}/swift-${{ matrix.swift }}-RELEASE-${{ matrix.linux }}-${{ matrix.release }}-${{ matrix.arch }}-sdk.tar.gz
41+
tar -xvf swift-${{ matrix.swift }}-RELEASE-${{ matrix.linux }}-${{ matrix.release }}-${{ matrix.arch }}-sdk.tar.gz
42+
mv swift-${{ matrix.swift }}-RELEASE-${{ matrix.linux }}-${{ matrix.release }}-${{ matrix.arch }} /opt/swift-${{ matrix.swift }}-RELEASE-${{ matrix.linux }}-${{ matrix.release }}-${{ matrix.arch }}
43+
- name: Swift Version
44+
run: swift --version
45+
- name: Build
46+
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
47+
48+
linux-arm-debian-build:
49+
name: Linux (Build)
50+
runs-on: ubuntu-latest
51+
strategy:
52+
matrix:
53+
config: ["debug" , "release"]
54+
swift: ["6.1.2"]
55+
linux: ["debian"]
56+
release: ["bookworm", "bullseye"]
57+
arch: ["armv7"]
58+
container: swift:${{ matrix.swift }}
59+
steps:
60+
- name: Checkout
61+
uses: actions/checkout@v4
62+
- name: Install dependencies
63+
run: apt update -y; apt install wget -y
64+
- name: Install SDK
65+
run: |
66+
wget https://github.com/xtremekforever/swift-armv7/releases/download/${{ matrix.swift }}/swift-${{ matrix.swift }}-RELEASE-${{ matrix.linux }}-${{ matrix.release }}-${{ matrix.arch }}-sdk.tar.gz
67+
tar -xvf swift-${{ matrix.swift }}-RELEASE-${{ matrix.linux }}-${{ matrix.release }}-${{ matrix.arch }}-sdk.tar.gz
68+
mv swift-${{ matrix.swift }}-RELEASE-${{ matrix.linux }}-${{ matrix.release }}-${{ matrix.arch }} /opt/swift-${{ matrix.swift }}-RELEASE-${{ matrix.linux }}-${{ matrix.release }}-${{ matrix.arch }}
69+
- name: Swift Version
70+
run: swift --version
71+
- name: Build
72+
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
73+
- name: Upload artifacts
74+
uses: actions/upload-artifact@v4
75+
with:
76+
name: "swift-${{ matrix.swift }}-RELEASE-${{ matrix.linux }}-${{ matrix.release }}-${{ matrix.arch }}-bluetooth-${{ matrix.config }}"
77+
path: .build/armv7-unknown-linux-gnueabihf/${{ matrix.config }}/libBluetooth.so
78+
2079

21-
armv7-bookworm:
22-
name: Armv7 Debian Bookworm
80+
linux-arm-test:
81+
name: Linux (Test)
2382
runs-on: ubuntu-latest
24-
container: swift:6.0.3
83+
strategy:
84+
matrix:
85+
swift: ["6.0.3"]
86+
container: swift:${{ matrix.swift }}
2587
steps:
2688
- name: Checkout
2789
uses: actions/checkout@v4
2890
- name: Install dependencies
2991
run: apt update -y; apt install wget -y
3092
- name: Install SDK
3193
run: |
32-
wget https://github.com/xtremekforever/swift-armv7/releases/download/6.0.3/swift-6.0.3-RELEASE-debian-bookworm-armv7-sdk.tar.gz
33-
tar -xvf swift-6.0.3-RELEASE-debian-bookworm-armv7-sdk.tar.gz
34-
mv swift-6.0.3-RELEASE-debian-bookworm-armv7 /opt/swift-6.0.3-RELEASE-debian-bookworm-armv7
94+
wget https://github.com/xtremekforever/swift-armv7/releases/download/${{ matrix.swift }}/swift-${{ matrix.swift }}-RELEASE-debian-bookworm-armv7-sdk.tar.gz
95+
tar -xvf swift-${{ matrix.swift }}-RELEASE-debian-bookworm-armv7-sdk.tar.gz
96+
mv swift-${{ matrix.swift }}-RELEASE-debian-bookworm-armv7 /opt/swift-${{ matrix.swift }}-RELEASE-debian-bookworm-armv7
3597
- name: Swift Version
3698
run: swift --version
3799
- name: Build
38-
run: swift build --build-tests --destination /opt/swift-6.0.3-RELEASE-debian-bookworm-armv7/debian-bookworm.json
100+
run: SWIFT_BUILD_DYNAMIC_LIBRARY=0 swift build --build-tests --destination /opt/swift-${{ matrix.swift }}-RELEASE-debian-bookworm-armv7/debian-bookworm.json
39101
- name: Upload artifacts
40102
uses: actions/upload-artifact@v4
41103
with:
42-
name: "armv7-bookworm"
104+
name: "linux-armv7-bookworm-tests-${{ matrix.swift }}"
43105
path: .build/armv7-unknown-linux-gnueabihf/debug/BluetoothPackageTests.xctest

.github/workflows/swift.yml

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,51 +5,52 @@ jobs:
55
macos:
66
name: macOS
77
runs-on: macos-15
8+
strategy:
9+
matrix:
10+
config: ["debug", "release"]
11+
options: ["", "SWIFT_BUILD_DYNAMIC_LIBRARY=1", "SWIFT_BLUETOOTH_C_SHIMS=1"]
812
steps:
913
- name: Checkout
1014
uses: actions/checkout@v4
1115
- name: Swift Version
1216
run: swift --version
13-
- name: Build (Debug)
14-
run: swift build -c debug
15-
- name: Build (Release)
16-
run: swift build -c release
17-
- name: Test (Debug)
18-
run: swift test -c debug
17+
- name: Build
18+
run: ${{ matrix.options }} swift build -c ${{ matrix.config }}
19+
- name: Test
20+
run: ${{ matrix.options }} swift test -c ${{ matrix.config }}
1921

2022
linux:
2123
name: Linux
2224
strategy:
2325
matrix:
24-
container: ["swift:6.0.3", "swift:6.1.1", "swiftlang/swift:nightly"]
26+
container: ["swift:6.0.3", "swift:6.1.1"]
27+
config: ["debug", "release"]
28+
options: ["", "SWIFT_BUILD_DYNAMIC_LIBRARY=1", "SWIFT_BLUETOOTH_C_SHIMS=1"]
2529
runs-on: ubuntu-latest
2630
container: ${{ matrix.container }}-jammy
2731
steps:
2832
- name: Checkout
2933
uses: actions/checkout@v4
3034
- name: Swift Version
3135
run: swift --version
32-
- name: Build (Debug)
33-
run: swift build -c debug
34-
- name: Build (Release)
35-
run: swift build -c release
36-
- name: Test (Debug)
37-
run: swift test -c debug
36+
- name: Build
37+
run: ${{ matrix.options }} swift build -c ${{ matrix.config }}
38+
- name: Test
39+
run: ${{ matrix.options }} swift test -c ${{ matrix.config }}
3840

39-
android:
40-
name: Android
41-
strategy:
42-
fail-fast: false
43-
matrix:
44-
swift: ['6.1', 'nightly-6.2']
45-
arch: ['x86_64']
46-
runs-on: macos-15
47-
timeout-minutes: 30
48-
steps:
49-
- uses: actions/checkout@v4
50-
- name: "Build Swift Package for Android"
51-
run: |
52-
brew install skiptools/skip/skip || (brew update && brew install skiptools/skip/skip)
53-
skip android sdk install --version ${{ matrix.swift }}
54-
# https://github.com/swiftlang/swift-driver/pull/1879
55-
ANDROID_NDK_ROOT="" skip android build
41+
android-arm:
42+
name: Android
43+
strategy:
44+
fail-fast: false
45+
matrix:
46+
swift: ['6.1', 'nightly-6.2']
47+
arch: ["aarch64", "x86_64"]
48+
runs-on: macos-15
49+
timeout-minutes: 30
50+
steps:
51+
- uses: actions/checkout@v4
52+
- name: "Build Swift Package for Android"
53+
run: |
54+
brew install skiptools/skip/skip || (brew update && brew install skiptools/skip/skip)
55+
skip android sdk install --version ${{ matrix.swift }}
56+
ANDROID_NDK_ROOT="" SWIFT_BLUETOOTH_C_SHIMS=0 skip android build --arch ${{ matrix.arch }}

0 commit comments

Comments
 (0)