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/actions/set_up_macos/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Set Up macOS Runner
description: Prepare macOS runner to execute tests.

inputs:
repo_name:
description: The name of the GitHub repo.
required: true
xcode_version:
description: The version of Xcode to use.
default: '14.0.1'

runs:
using: composite
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ inputs.xcode_version }}
- name: Confirm Xcode Version
shell: bash
run: |
# Print used xCode version
xcode-select -print-path
xcodebuild -version
- uses: cgrindel/gha_set_up_bazel@v1
with:
repo_name: ${{ inputs.repo_name }}

19 changes: 19 additions & 0 deletions .github/actions/test_example/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Test Examples
description: Execute an example integration test.

inputs:
example_name:
description: The name of the example.
required: true
bazel_version:
description: The Bazel version suffix (e.g. semver or .bazelversion)
required: true

runs:
using: composite
steps:
- name: Execute Integration Test
shell: bash
run: |
bazelisk test //examples:${{ inputs.example_name }}_test_bazel_${{ inputs.bazel_version }}

69 changes: 59 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,68 @@ on:

jobs:

macos_build:
macos_tidy_and_test:
runs-on: macos-12
steps:
- uses: maxim-lobanov/setup-xcode@v1
- uses: actions/checkout@v3
- uses: ./.github/actions/set_up_macos
with:
xcode-version: '14.0.1'
- name: Confirm Xcode Version
xcode_version: '14.0.1'
repo_name: swift_bazel
- name: Ensure everything is tidy
shell: bash
run: |
# Print used xCode version
xcode-select -print-path
xcodebuild -version
bazelisk run //:tidy_check
- name: Execute Tests
shell: bash
run: |
bazelisk test //...


macos_single_bazel_ver_int_test_matrix:
strategy:
matrix:
example:
- "firebase_example"
- "interesting_deps"
- "ios_sim"
- "objc_code"
- "phone_number_kit"
- "xcmetrics_example"
bazel_version:
- ".bazelversion"
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- uses: cgrindel/gha_set_up_bazel@v1
- uses: ./.github/actions/set_up_macos
with:
xcode_version: '14.0.1'
repo_name: swift_bazel
- uses: ./.github/actions/build_and_test
- uses: ./.github/actions/test_example
with:
example_name: ${{ matrix.example }}
bazel_version: ${{ matrix.bazel_version }}

macos_multi_bazel_ver_int_test_matrix:
strategy:
matrix:
example:
- "http_archive_ext_deps"
- "pkg_manifest_minimal"
bazel_version:
- ".bazelversion"
- "5_4_0"
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/set_up_macos
with:
xcode_version: '14.0.1'
repo_name: swift_bazel
- uses: ./.github/actions/test_example
with:
example_name: ${{ matrix.example }}
bazel_version: ${{ matrix.bazel_version }}

ubuntu_build:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -57,7 +102,11 @@ jobs:

all_ci_tests:
runs-on: ubuntu-20.04
needs: [macos_build, ubuntu_build]
needs:
- macos_tidy_and_test
- macos_single_bazel_ver_int_test_matrix
- macos_multi_bazel_ver_int_test_matrix
- ubuntu_build
if: ${{ always() }}
steps:
- uses: cgrindel/gha_join_jobs@v1
Expand Down