Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sandbox mode to CI testing matrix #895

Merged
merged 1 commit into from
Aug 20, 2024
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
12 changes: 11 additions & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
common --enable_bzlmod

# Spawn strategy required for some tests
build --spawn_strategy=standalone
build --spawn_strategy=local

# Setup Xcode configuration.
build --xcode_version_config=//:host_xcodes
Expand Down Expand Up @@ -62,6 +62,16 @@ build:remote_cache --noslim_profile
build:remote_cache --remote_cache=grpcs://remote.buildbuddy.io
build:remote_cache --remote_timeout=3600

build:sandboxed --spawn_strategy=sandboxed
# Otherwise it still use the worker strategy
build:sandboxed --strategy=SwiftCompile=sandboxed
build:sandboxed --strategy=Genrule=sandboxed,local
build:sandboxed --strategy=StoryboardCompile=sandboxed,local
build:sandboxed --strategy=CleaningFramework=sandboxed,local
build:sandboxed --strategy=StoryboardLink=sandboxed,local
build:sandboxed --strategy=ProcessAndSign=sandboxed,local
build:sandboxed --strategy=AssetCatalogCompile=sandboxed,local

# By default don't upload local results to remote cache, only CI does this.
build --noremote_upload_local_results
build:ci --remote_upload_local_results
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ concurrency:
# when adding a new job / changing the matrix, make sure to update all jobs
jobs:
integration_tests:
name: Build and test (Bazel ${{ matrix.bazel_version }} / Xcode ${{ matrix.xcode_version }} / Virtual Frameworks ${{ matrix.virtual_frameworks }})
name: Build and test (Bazel ${{ matrix.bazel_version }} / Xcode ${{ matrix.xcode_version }} / Virtual Frameworks ${{ matrix.virtual_frameworks }}) / Sandbox ${{ matrix.sandbox }}
runs-on: macos-14
strategy:
fail-fast: false
matrix:
bazel_version: [6.5.0, 7.1.0]
xcode_version: [15.2]
virtual_frameworks: [true, false]
sandbox: [true, false]
env:
XCODE_VERSION: ${{ matrix.xcode_version }}
USE_BAZEL_VERSION: ${{ matrix.bazel_version }}
Expand All @@ -34,6 +35,10 @@ jobs:
name: Add vfs config
run: |
echo "build --config=vfs" >> user.bazelrc
- if: matrix.sandbox
name: Enable sandbox mode
run: |
echo "build --config=sandboxed" >> user.bazelrcc
- name: Build and Test
run: |
# non-iOS tests
Expand Down
2 changes: 0 additions & 2 deletions rules/library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -953,8 +953,6 @@ def apple_library(
generated_swift_header_name = module_name + "-Swift.h"

if module_map:
# TODO: now that we always add module_map as a swiftc_input,
# we should consider removing this one if it's not needed
extend_modulemap(
name = module_map + ".extended." + name,
destination = "%s.extended.modulemap" % name,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
#import <TestImports-Unit-Tests/testhelper.h>
#import <TestImports-App/Header2.h>
2 changes: 1 addition & 1 deletion tests/ios/unit-test/test-imports-app/test.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ class SwiftTests : XCTestCase {
func testPasses() {
_ = EmptyStruct()
XCTAssertTrue(true)
XCTAssertEqual(TestHelper.createString(), "ObjcTestHelperString_EnumValue=1")
XCTAssertEqual(TestHelper.createString(), "ObjcTestHelperString_EnumValue=\(AppErrorCode.unknown.rawValue)")
}
}