Skip to content

Commit 129b31a

Browse files
committed
Add more build and test actions to the CI
1 parent 2745d07 commit 129b31a

File tree

5 files changed

+25
-14
lines changed

5 files changed

+25
-14
lines changed

.github/workflows/ci.yaml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,19 @@ jobs:
1717
run: "sudo xcode-select -s /Applications/Xcode_$XCODE_VERSION.app"
1818
- name: Checkout
1919
uses: actions/checkout@v4
20-
- name: Build project
20+
- name: Lint Swift files
21+
run: swift format lint Sources/ Tests/ Example/ --recursive
22+
- name: Build sourcekit-bazel-bsp (debug)
2123
run: swift build
22-
- name: Run tests
24+
- name: Test sourcekit-bazel-bsp
2325
run: swift test
24-
- name: Build example iOS app
26+
- name: Build sourcekit-bazel-bsp (release)
27+
run: swift build -c release
28+
- name: Build example //HelloWorld iOS app
2529
run: |
2630
cd Example
27-
bazel build //HelloWorld
28-
# TODO: add test target to the example iOS app
29-
# - name: Test example iOS app
30-
# run: |
31-
# cd Example
32-
# bazel test //HelloWorld/HelloWorldTests/...
31+
bazelisk build //HelloWorld
32+
- name: Test example //HelloWorld iOS app
33+
run: |
34+
cd Example
35+
bazelisk test //HelloWorld:HelloWorldTests

Example/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
/.settings
1212
/bazel.iml
1313
/bazel-*
14+
/custom-*
1415
/output/
1516
/production
1617
/.sass-cache

Example/MODULE.bazel

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,17 @@ bazel_dep(
44
repo_name = "build_bazel_rules_swift",
55
)
66

7+
# We need a commit that has not yet made into a release, so overriding it for now
78
bazel_dep(
89
name = "rules_apple",
9-
version = "4.0.1",
1010
repo_name = "build_bazel_rules_apple",
1111
)
12+
archive_override(
13+
module_name = "rules_apple",
14+
sha256 = "0abe1a851d65d64a1692bdc95a0649cba4218f0007d36eda030eb6bdfd6b6937",
15+
strip_prefix = "rules_apple-a9fcb1c3ae6382534d773d73c035035e9764eadb",
16+
url = "https://github.com/bazelbuild/rules_apple/archive/a9fcb1c3ae6382534d773d73c035035e9764eadb.zip",
17+
)
18+
1219

1320
bazel_dep(name = "apple_support", version = "1.22.1", repo_name = "build_bazel_apple_support")

Example/MODULE.bazel.lock

Lines changed: 1 addition & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sources/SourceKitBazelBSP/MessageHandler/BSPServerMessageHandlerImpl.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,9 @@ final class BSPServerMessageHandlerImpl: @unchecked Sendable {
219219
var affectedTargets: Set<URI> = []
220220
for change in changes {
221221
let targetsForSrc = workspaceBuildTargetsHandler.srcToTargetsMap[change] ?? []
222-
targetsForSrc.forEach { affectedTargets.insert($0) }
222+
for target in targetsForSrc {
223+
affectedTargets.insert(target)
224+
}
223225
}
224226
let response = OnBuildTargetDidChangeNotification(
225227
changes: affectedTargets.map {

0 commit comments

Comments
 (0)