Repository navigation
ci: add nightly macOS® brick tests #13
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
Open
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,13 +21,32 @@ env: | |
|
|
||
| jobs: | ||
| brick-tests: | ||
| name: Brick tests (Linux® ARM64, Clang) | ||
| runs-on: ubuntu-24.04-arm | ||
| name: Brick tests (${{ matrix.name }}) | ||
| runs-on: ${{ matrix.os }} | ||
| timeout-minutes: 360 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - name: Linux® ARM64, Clang | ||
| os: ubuntu-24.04-arm | ||
| cc: clang-18 | ||
| cxx: clang++-18 | ||
| parallel: 4 | ||
| build_dir: build | ||
| from_source: "OFF" | ||
| - name: macOS® ARM64, AppleClang | ||
| os: macos-15 | ||
| cc: /usr/bin/clang | ||
| cxx: /usr/bin/clang++ | ||
| parallel: 3 | ||
| build_dir: build_native | ||
| from_source: "ON" | ||
| env: | ||
| CC: clang-18 | ||
| CXX: clang++-18 | ||
| CMAKE_BUILD_PARALLEL_LEVEL: "4" | ||
| CC: ${{ matrix.cc }} | ||
| CXX: ${{ matrix.cxx }} | ||
| CMAKE_BUILD_PARALLEL_LEVEL: ${{ matrix.parallel }} | ||
| COMPUTE_FLOW_CI_BUILD_DIR: ${{ matrix.build_dir }} | ||
| COMPUTE_FLOW_HOME: ${{ github.workspace }}/.compute-flow | ||
| COMPUTE_FLOW_TEST_MODEL_HOME: /tmp/cf-${{ github.run_id }}-${{ github.run_attempt }} | ||
| steps: | ||
|
|
@@ -38,11 +57,17 @@ jobs: | |
| with: | ||
| python-version: "3.12" | ||
| - name: Install Linux® system dependencies | ||
| if: runner.os == 'Linux' # trademark-check: allow | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y --no-install-recommends \ | ||
| build-essential clang-18 lld-18 ninja-build pkg-config python3-dev \ | ||
| libsndfile1 | ||
| - name: Install macOS® system dependencies | ||
| if: runner.os == 'macOS' # trademark-check: allow | ||
| env: | ||
| HOMEBREW_NO_AUTO_UPDATE: "1" | ||
| run: brew install ninja pkg-config | ||
| - name: Install Python dependencies | ||
| run: uv sync --locked --no-default-groups --group build --group bricks --group tests | ||
| - name: Install bricks | ||
|
|
@@ -51,26 +76,32 @@ jobs: | |
| uv run compute-flow brick install --all | ||
| uv run compute-flow brick list | ||
| ln -s "$COMPUTE_FLOW_HOME" "$COMPUTE_FLOW_TEST_MODEL_HOME" | ||
| # TODO: Build bricks with the Brick Manager using `compute-flow build native`. | ||
| - name: Build from source with Brick Manager | ||
| if: matrix.from_source == 'ON' | ||
| run: uv run compute-flow build native --from-source --jobs "$CMAKE_BUILD_PARALLEL_LEVEL" | ||
| # TODO: Check whether `compute-flow build native` can replace the direct CMake | ||
| # commands used to configure and build generated brick tests. | ||
| - name: Configure generated brick tests | ||
| run: | | ||
| uv run cmake -S . -B build \ | ||
| uv run cmake -S . -B "$COMPUTE_FLOW_CI_BUILD_DIR" \ | ||
| -DBUILD_TESTING=ON \ | ||
| -DCMAKE_BUILD_TYPE=Release | ||
| # TODO: Check whether these prebuilt dependency assertions can be removed. | ||
| - name: Require prebuilt dependencies | ||
| if: matrix.from_source == 'OFF' | ||
| run: | | ||
| cache=build/CMakeCache.txt | ||
| cache="$COMPUTE_FLOW_CI_BUILD_DIR/CMakeCache.txt" | ||
| grep -qx 'COMPUTE_FLOW_USE_PREBUILT_DEPS:BOOL=ON' "$cache" | ||
| for dependency in PROTOBUF LITERT EXECUTORCH ONNXRUNTIME MNN SENTENCEPIECE; do | ||
| grep -qx "COMPUTE_FLOW_BUILD_${dependency}_FROM_SOURCE:BOOL=OFF" "$cache" | ||
| done | ||
| - name: Build generated brick tests | ||
| run: uv run cmake --build build --parallel "$CMAKE_BUILD_PARALLEL_LEVEL" | ||
| if: matrix.from_source == 'OFF' | ||
| run: uv run cmake --build "$COMPUTE_FLOW_CI_BUILD_DIR" --parallel "$CMAKE_BUILD_PARALLEL_LEVEL" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would a TODO to check whether we can use the brick manager to build the tests |
||
| - name: Run generated brick tests | ||
| run: | | ||
| set -euo pipefail | ||
| export PYTHONPATH="$GITHUB_WORKSPACE/build/python${PYTHONPATH:+:$PYTHONPATH}" | ||
| export PYTHONPATH="$GITHUB_WORKSPACE/$COMPUTE_FLOW_CI_BUILD_DIR/python${PYTHONPATH:+:$PYTHONPATH}" | ||
| # TODO: Discover installed bricks with generated tests automatically. | ||
| bricks=( | ||
| vad:silero-vad | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add TODO to check whether it is needed