Skip to content

Commit a206583

Browse files
committed
Build iOS in CI
1 parent b44d952 commit a206583

File tree

1 file changed

+48
-19
lines changed

1 file changed

+48
-19
lines changed

.github/workflows/ci.yml

Lines changed: 48 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ env:
1414
CARGO_TERM_VERBOSE: true
1515
FEATURES: malloc,block,exception,catch_all,verify_message
1616
UNSTABLE_FEATURES: unstable_autoreleasesafe
17+
MACOSX_DEPLOYMENT_TARGET: 10.7
18+
IPHONEOS_DEPLOYMENT_TARGET: 7.0
1719
# We only support compiling Objective-C code with clang
1820
CC: clang
1921
CXX: clang++
@@ -53,6 +55,7 @@ jobs:
5355
target: i686-apple-darwin
5456
rust:
5557
toolchain: nightly
58+
target: x86_64-apple-darwin
5659
components: rust-src
5760
args: -Zbuild-std -Zdoctest-xcompile
5861
# 32-bit support was removed in 10.15, so we can't test the
@@ -66,16 +69,44 @@ jobs:
6669
- name: Test GNUStep 32bit
6770
os: ubuntu-latest
6871
target: i686-unknown-linux-gnu
69-
rust:
70-
toolchain: stable
71-
# Install compiler for i686-unknown-linux-gnu
72-
target: i686-unknown-linux-gnu
7372
cflags: -m32
7473
configureflags: --target=x86-pc-linux-gnu
7574
args: --features gnustep-1-9
76-
77-
# - { target: x86_64-apple-ios, os: macos-latest, }
78-
# - { target: aarch64-apple-ios, os: macos-latest, }
75+
- name: Build iOS ARM64
76+
os: macos-latest
77+
target: aarch64-apple-ios
78+
test-args: --no-run
79+
- name: Build iOS 64bit x86
80+
os: macos-latest
81+
target: x86_64-apple-ios
82+
test-args: --no-run
83+
- name: Build iOS ARMv7
84+
os: macos-latest
85+
target: armv7-apple-ios
86+
rust:
87+
toolchain: nightly
88+
target: x86_64-apple-darwin
89+
components: rust-src
90+
args: -Zbuild-std -Zdoctest-xcompile
91+
test-args: --no-run
92+
- name: Build iOS ARMv7s
93+
os: macos-latest
94+
target: armv7s-apple-ios
95+
rust:
96+
toolchain: nightly
97+
target: x86_64-apple-darwin
98+
components: rust-src
99+
args: -Zbuild-std -Zdoctest-xcompile
100+
test-args: --no-run
101+
- name: Build iOS 32bit x86
102+
os: macos-latest
103+
target: i386-apple-ios
104+
rust:
105+
toolchain: nightly
106+
target: x86_64-apple-darwin
107+
components: rust-src
108+
args: -Zbuild-std -Zdoctest-xcompile
109+
test-args: --no-run
79110

80111
env:
81112
CARGO_BUILD_TARGET: ${{ matrix.target }}
@@ -102,6 +133,13 @@ jobs:
102133
libc6-dev:i386 libstdc++-10-dev:i386 libffi-dev:i386 \
103134
libxml2-dev:i386 libicu-dev:i386
104135
136+
- name: Download macOS 10.13 SDK (supports 32-bit)
137+
if: matrix.target == 'i686-apple-darwin'
138+
run: |
139+
wget https://github.com/alexey-lysiuk/macos-sdk/releases/download/10.13/MacOSX10.13.tar.bz2
140+
tar -xyf MacOSX10.13.tar.bz2
141+
echo "SDKROOT=$(pwd)/MacOSX10.13.sdk" >> $GITHUB_ENV
142+
105143
- name: Cache GNUStep
106144
if: contains(matrix.os, 'ubuntu')
107145
id: cache-gnustep
@@ -175,23 +213,14 @@ jobs:
175213
key: cargo-${{ matrix.name }}-${{ hashFiles('**/Cargo.toml') }}
176214

177215
- name: Install Rust toolchain
178-
# Assume default toolchain is already installed
179-
if: matrix.rust
180216
uses: actions-rs/toolchain@v1
181217
with:
182-
toolchain: ${{ matrix.rust.toolchain }}
218+
toolchain: ${{ matrix.rust.toolchain || 'stable' }}
183219
profile: minimal
184220
override: true
185221
components: ${{ matrix.rust.components }}
186-
# Yes, matrix.rust.target, not matrix.target
187-
target: ${{ matrix.rust.target }}
188-
189-
- name: Download macOS 10.13 SDK (supports 32-bit)
190-
if: matrix.target == 'i686-apple-darwin'
191-
run: |
192-
wget https://github.com/alexey-lysiuk/macos-sdk/releases/download/10.13/MacOSX10.13.tar.bz2
193-
tar -xyf MacOSX10.13.tar.bz2
194-
echo "SDKROOT=$(pwd)/MacOSX10.13.sdk" >> $GITHUB_ENV
222+
# Allows installing for a different base target
223+
target: ${{ matrix.rust.target || matrix.target }}
195224

196225
- name: Check documentation
197226
uses: actions-rs/cargo@v1

0 commit comments

Comments
 (0)