-
Notifications
You must be signed in to change notification settings - Fork 64
[CI] Use GitHub Actions for CI #200
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
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
b4a918e
use GA
czoido 08538dd
add PYTHONPATH
czoido 12f811f
fix permissions
czoido 2e18c77
wip
czoido f3c0ae8
wip
czoido e9d3dee
zlib does not build for clang 17 in macOS
czoido 6a8108c
install automake autoconf
czoido c538ce1
wip
czoido d19e6d7
revert
czoido cd28d6d
group
czoido f95bfaf
wip
czoido 8fd4e89
wip
czoido d525f8d
clean
czoido 9bdefd2
clean
czoido 41b5303
wip
czoido 38ac1bc
wip
czoido 76d1ad2
wip
czoido a1d7c5f
wip
czoido 77bba4a
wip
czoido 929c63c
wip
czoido 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
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| name: CI Examples | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| branches: [ main ] | ||
|
|
||
| jobs: | ||
| run-examples: | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-latest, macos-latest, windows-latest] | ||
| conan-version: [release, develop] | ||
| runs-on: ${{ matrix.os }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.11" | ||
|
|
||
| - name: Install CMake | ||
| uses: jwlawson/actions-setup-cmake@v1.14 | ||
| with: | ||
| cmake-version: "3.23" | ||
|
|
||
| - name: Install autotools (macOS) | ||
| if: runner.os == 'macOS' | ||
| run: brew install automake autoconf | ||
|
|
||
| - name: Install Conan | ||
| shell: bash | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| if [[ "${{ matrix.conan-version }}" == "develop" ]]; then | ||
| pip install -e git+https://github.com/conan-io/conan.git@develop2#egg=conan --upgrade | ||
| else | ||
| pip install conan --upgrade | ||
| fi | ||
| pip install meson | ||
| conan --version | ||
| conan profile detect --force | ||
|
|
||
| - name: Find and run examples | ||
| shell: bash | ||
| run: | | ||
| export PYTHONPATH="${{ github.workspace }}${PYTHONPATH:+:$PYTHONPATH}" | ||
|
|
||
| # Find all ci_test_example files | ||
| if [[ "${{ runner.os }}" == "Windows" ]]; then | ||
| EXAMPLES=$(find . -name "ci_test_example.*" -type f \( -name "*.py" -o -name "*.bat" \) | sort) | ||
| else | ||
| EXAMPLES=$(find . -name "ci_test_example.*" -type f \( -name "*.py" -o -name "*.sh" \) | sort) | ||
| fi | ||
|
|
||
| # Filter out examples that require specific versions or tools not available in CI | ||
| # FIXME: Bazel examples require specific Bazel versions (6.3.2, 7.1.2) that are not installed in GitHub Actions runners | ||
| EXAMPLES=$(echo "$EXAMPLES" | grep -v "bazeltoolchain" || true) | ||
| # FIXME: Cross-building examples require cross-compilation toolchains (e.g., arm-linux-gnueabihf-gcc-9) that are not installed in GitHub Actions runners | ||
| EXAMPLES=$(echo "$EXAMPLES" | grep -v "cross_building" || true) | ||
|
|
||
| # FIXME: Filter out tensorflow examples in PRs | ||
| IS_PR="${{ github.event_name == 'pull_request' }}" | ||
| if [[ "$IS_PR" == "true" ]]; then | ||
| EXAMPLES=$(echo "$EXAMPLES" | grep -v tensorflow || true) | ||
| fi | ||
|
|
||
| if [[ -z "$EXAMPLES" ]]; then | ||
| echo "No examples found to run" | ||
| exit 0 | ||
| fi | ||
|
|
||
| echo "Examples to run:" | ||
| echo "$EXAMPLES" | ||
|
|
||
| # Run each example | ||
| set -e | ||
| while IFS= read -r example; do | ||
| if [[ -z "$example" ]]; then | ||
| continue | ||
| fi | ||
|
|
||
| example_normalized=$(echo "$example" | sed 's|\\|/|g') | ||
| example_dir=$(dirname "$example_normalized") | ||
| example_file=$(basename "$example_normalized") | ||
|
|
||
| # Start group for this example | ||
| echo "::group::Running example: $example_dir" | ||
|
|
||
| cd "${{ github.workspace }}/$example_dir" || exit 1 | ||
|
|
||
| if [[ "$example_file" == *.py ]]; then | ||
| python "$example_file" | ||
| elif [[ "$example_file" == *.sh ]]; then | ||
| bash "$example_file" | ||
| elif [[ "$example_file" == *.bat ]]; then | ||
| if [[ "${{ runner.os }}" == "Windows" ]]; then | ||
| cmd //c "$example_file" | ||
| else | ||
| echo "Skipping .bat file on non-Windows platform" | ||
| fi | ||
| fi | ||
|
|
||
| cd "${{ github.workspace }}" || exit 1 | ||
|
|
||
| # End group for this example | ||
| echo "::endgroup::" | ||
| done <<< "$EXAMPLES" | ||
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
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
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 |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| [requires] | ||
| zlib/1.2.13 | ||
| zlib/1.3.1 | ||
|
|
||
| [tool_requires] | ||
| cmake/3.25.3 | ||
|
|
||
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
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.
Uh oh!
There was an error while loading. Please reload this page.