Skip to content

Add support for bzlmod #2515

Add support for bzlmod

Add support for bzlmod #2515

Workflow file for this run

name: Tests
on:
pull_request:
push:
branches:
- master
# One active job per PR, cancel older ones on push
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
integration_tests:
name: Build and Test
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Preflight Env
run: .github/workflows/preflight_env.sh
- name: Build and Test
run: |
# non-iOS tests
bazelisk test \
--config=ci_with_caches \
-- \
//... \
-//tests/ios/...
# Clean up after simctl (https://github.com/bazelbuild/rules_apple/issues/185)
pgrep Simulator | xargs kill || true
# Create single ephemeral iOS sim
SIMULATOR_UDID=$(./tools/tests/prepare_sim.py)
# iOS tests
bazelisk test \
--config=ci_with_caches \
--config=ios \
--test_arg=--destination=platform=ios_simulator,id=$SIMULATOR_UDID \
-- \
//tests/ios/...
- uses: actions/upload-artifact@v2
if: failure()
with:
name: bazel-testlogs
path: bazel-testlogs
build_virtual_frameworks:
# Build the entire tree with this feature enabled. Longer term, we'll likely
# consider merging this feature into the default behavior and can re-align
# the CI job
name: Build and Test ( Virtual Frameworks )
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Preflight Env
run: .github/workflows/preflight_env.sh
- name: Build and Test
run: |
# non-iOS tests
bazelisk test \
--config=ci_with_caches \
--config=vfs \
-- \
//... \
-//tests/ios/...
# iOS tests
bazelisk test \
--config=ci_with_caches \
--config=ios \
--config=vfs \
-- \
//tests/ios/...
- uses: actions/upload-artifact@v2
if: failure()
with:
name: bazel-testlogs
path: bazel-testlogs
lts_ios_integration_tests:
name: Build and Test ( Virtual Frameworks + LTS )
runs-on: macos-12
env:
USE_BAZEL_VERSION: 5.3.2
steps:
- uses: actions/checkout@v3
- name: Preflight Env
run: .github/workflows/preflight_env.sh
- name: Build and Test
run: |
# iOS tests without bzlmod on Bazel 5
bazelisk build \
--noexperimental_enable_bzlmod \
--config=ci_with_caches \
--config=ios \
--config=vfs \
-- \
//tests/ios/...
- uses: actions/upload-artifact@v2
if: failure()
with:
name: bazel-testlogs
path: bazel-testlogs
build_arm64_simulator:
name: Build arm64 Simulator
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Preflight Env
run: .github/workflows/preflight_env.sh
- name: Build and Test
run: |
bazelisk build \
--config=ci_with_caches \
--config=vfs \
--ios_multi_cpus=sim_arm64 \
-- \
//... \
-//tests/ios/...
# Misc issues:
# - Fails on a non fat framework for //tests/ios/unit-test/test-imports-app/
bazelisk build \
--config=ci_with_caches \
--config=ios \
--config=vfs \
--ios_multi_cpus=sim_arm64 \
-- \
//tests/ios/... \
-//tests/ios/unit-test/test-imports-app/...
- uses: actions/upload-artifact@v2
if: failure()
with:
name: bazel-testlogs
path: bazel-testlogs
lint:
name: Check Starlark and Docs
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Preflight Env
run: .github/workflows/preflight_env.sh
# Note: we need to pass the absolute to the Bazel run
- name: buildifier
run: |
find $PWD -type f \( -name 'WORKSPACE' -o -name '*.bzl' -o -name '*.bazel' \) | xargs bazel run //:buildifier -- -lint=fix
git diff --exit-code
- name: Check docs
run: |
# TODO: stardoc doesn't currently support bzlmod: https://github.com/bazelbuild/stardoc/issues/117
bazelisk run \
--noexperimental_enable_bzlmod \
--config=ci_with_caches \
//docs
git diff --exit-code docs
xcodeproj_tests:
name: .xcodeproj Tests on Xcode 14.2.0
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Preflight Env
run: .github/workflows/preflight_env.sh
- name: Run tests
run: ./tests/xcodeproj-tests.sh --run && ./tests/test-tests.sh
- uses: actions/upload-artifact@v2
if: failure()
with:
name: bazel-testlogs
path: bazel-testlogs
lldb_ios_tests_xcode:
name: LLDB tests on Xcode 14.2.0
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Preflight Env
run: .github/workflows/preflight_env.sh
- name: Run tests
run: |
bazelisk test \
--config=ci_with_caches \
--config=ios_lldb_test \
-- \
tests/ios/lldb/app:objc_app_po_test \
tests/ios/lldb/app:objc_app_variable_test
- uses: actions/upload-artifact@v2
if: failure()
with:
name: bazel-testlogs
path: bazel-testlogs
multi_arch_support:
name: Build iOS App for Multiple Architecture
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Preflight Env
run: .github/workflows/preflight_env.sh
- name: Build App
run: |
bazelisk build \
--config=ci_with_caches \
--config=ios_multi_arch_test \
-- \
tests/ios/app/App