Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,30 @@ jobs:
if: steps.filter.outputs.changed == 'true'
working-directory: domains/games/apps/wordchains_ios
run: swift test

- uses: bazel-contrib/setup-bazel@0.18.0
if: steps.filter.outputs.changed == 'true'
with:
bazelisk-cache: true
disk-cache: test-ios
repository-cache: true

- name: Build iOS app with bazel
if: steps.filter.outputs.changed == 'true'
run: |
bazel build //domains/games/apps/wordchains_ios:WordChains \
--ios_minimum_os=17.0 \
--apple_platform_type=ios

# swift.enable_testing is needed for @testable imports because the repo
# builds -c opt, where rules_swift disables testability by default.
# Without an explicit simulator device the test runner pairs an ancient
# device type (iPhone 6s Plus) with the latest iOS runtime and the
# simulator fails to boot.
- name: Run iOS unit tests with bazel
if: steps.filter.outputs.changed == 'true'
run: |
bazel test //domains/games/apps/wordchains_ios:WordChainsTests \
--ios_minimum_os=17.0 \
--features=swift.enable_testing \
--ios_simulator_device="iPhone 16"
4 changes: 0 additions & 4 deletions .github/workflows/release-wordchains-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,7 @@ jobs:
disk-cache: release-wordchains-ios
repository-cache: true

# rules_apple doesn't support Bazel 9 yet; pin to Bazel 8 LTS for iOS builds.
# Track: https://github.com/bazelbuild/rules_apple/issues
- name: Build iOS app
env:
USE_BAZEL_VERSION: 8.2.1
run: |
bazel build //domains/games/apps/wordchains_ios:WordChains \
--ios_minimum_os=17.0 \
Expand Down
19 changes: 11 additions & 8 deletions domains/games/apps/wordchains_ios/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ swift_library(
":word_graph_json",
],
module_name = "WordChains",
tags = ["manual"],
target_compatible_with = ["@platforms//os:macos"],
target_compatible_with = ["@platforms//os:ios"],
)

# Tagged manual: rules_apple doesn't support Bazel 9 yet.
# https://github.com/bazelbuild/rules_apple/issues/2863
# Build with: USE_BAZEL_VERSION=8.2.1 bazel build //domains/games/apps/wordchains_ios:WordChains
# The Apple bundling rules transition to an iOS target platform before
# target_compatible_with is evaluated, so os:ios can't keep Linux CI off
# them — Linux analysis fails resolving an Apple C++ toolchain instead of
# skipping. Tag them manual; the test-ios job and the release workflow
# request them by explicit label, which builds manual targets.
ios_application(
name = "WordChains",
bundle_id = "com.muchq.wordchains",
Expand All @@ -35,7 +36,7 @@ ios_application(
":word_graph_json",
] + glob(["Sources/Resources/**"]),
tags = ["manual"],
target_compatible_with = ["@platforms//os:macos"],
target_compatible_with = ["@platforms//os:ios"],
visibility = ["//visibility:public"],
deps = [":WordChainsLib"],
)
Expand All @@ -44,11 +45,13 @@ swift_library(
name = "WordChainsTestLib",
testonly = True,
srcs = glob(["Tests/**/*.swift"]),
tags = ["manual"],
target_compatible_with = ["@platforms//os:macos"],
target_compatible_with = ["@platforms//os:ios"],
deps = [":WordChainsLib"],
)

# Unlike ios_application, the test rule stays in the host configuration
# (only its deps transition to iOS), so it must be compatible with the
# macOS host that runs the simulator.
ios_unit_test(
name = "WordChainsTests",
minimum_os_version = "17.0",
Expand Down
Loading