Skip to content

Commit

Permalink
Add CI tests for Build without the Bytes
Browse files Browse the repository at this point in the history
Adds CI tests for Build without the Bytes and new rules_swift 2.x
  • Loading branch information
luispadron committed Jul 10, 2024
1 parent 0a5d081 commit eba78af
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .github/workflows/preflight_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ if [[ "$*" == *--no-bzlmod* ]]; then
echo "build --noenable_bzlmod" >> user.bazelrc
fi

# If `RULES_APPLE_SWIFT_VERSION` is set to `latest` use the master branch of rules_swift and rules_apple.
if [[ "${RULES_APPLE_RULES_SWIFT_VERSION}" == "latest" ]]; then
gh repo clone bazelbuild/rules_swift /tmp/rules_swift
gh repo clone bazelbuild/rules_apple /tmp/rules_apple
echo "common --override_module=rules_swift=/tmp/rules_swift" >> user.bazelrc
echo "common --override_module=rules_apple=/tmp/rules_apple" >> user.bazelrc
fi

# Add the ci config override.
echo "common --config=ci" >> user.bazelrc

Expand Down
61 changes: 60 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
fail-fast: false
matrix:
bazel_version: [6.5.0, 7.1.0]
xcode_version: [15.2]
virtual_frameworks: [true, false]
xcode_version: [15.2]
env:
XCODE_VERSION: ${{ matrix.xcode_version }}
USE_BAZEL_VERSION: ${{ matrix.bazel_version }}
Expand Down Expand Up @@ -155,3 +155,62 @@ jobs:
--config=ios_multi_arch_test \
-- \
tests/ios/app/App
build_without_the_bytes:
name: Build without the Bytes (Bazel ${{ matrix.bazel_version }} / Outputs level ${{matrix.download_outputs_level}} / rule versions ${{ matrix.rule_versions }} / Xcode ${{ matrix.xcode_version }})
runs-on: macos-14
strategy:
fail-fast: false
matrix:
bazel_version: [7.1.0]
download_outputs_level: ["minimal", "toplevel"]
rule_versions: ["current", "latest"]
xcode_version: [15.2]
env:
RULES_APPLE_RULES_SWIFT_VERSION: ${{ matrix.rule_versions }}
USE_BAZEL_VERSION: ${{ matrix.bazel_version }}
XCODE_VERSION: ${{ matrix.xcode_version }}
steps:
- uses: actions/checkout@v4
- name: Preflight Env
run: .github/workflows/preflight_env.sh
- name: Build using Build without the Bytes
run: |
# non-iOS
bazelisk build \
--remote_download_outputs=${{matrix.download_outputs_level}} \
--disk_cache="/tmp/bazel-rules_ios-bwtb-cache" \
-- \
//... \
-//tests/ios/...
# Clean the caches to test that BwtB works
bazel clean --expunge
# Run the same build again
bazelisk build \
--remote_download_outputs=${{matrix.download_outputs_level}} \
--disk_cache="/tmp/bazel-rules_ios-bwtb-cache" \
-- \
//... \
-//tests/ios/...
# iOS
bazelisk build \
--config=ios \
--remote_download_outputs=${{matrix.download_outputs_level}} \
--disk_cache="/tmp/bazel-rules_ios-bwtb-cache" \
-- \
//tests/ios/...
# Clean the caches to test that BwtB works
bazel clean --expunge
# Run the same build again
bazelisk build \
--config=ios \
--remote_download_outputs=${{matrix.download_outputs_level}} \
--disk_cache="/tmp/bazel-rules_ios-bwtb-cache" \
-- \
//tests/ios/...
- uses: actions/upload-artifact@v4
if: failure()
with:
name: bazel-testlogs
path: bazel-testlogs

0 comments on commit eba78af

Please sign in to comment.