-
Notifications
You must be signed in to change notification settings - Fork 188
Rework CI workflow #944
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
Rework CI workflow #944
Changes from 44 commits
Commits
Show all changes
70 commits
Select commit
Hold shift + click to select a range
f96a0d6
Add config file for actionlint
mhucka 4070812
Add `ubuntu-slim` to `actionlint.yaml`
mhucka 05c168f
Add new reusable action for setting up Bazel
mhucka e3456f6
Put some more cibuildwheel config settings in pyproject.toml
mhucka 3a3cb08
Pin action versions to hashes
mhucka 39dc2ca
Remove old versions of CI workflows
mhucka ca36548
Collect CI workflows back into one file
mhucka f9258c1
Remove workflow_dispatch option for uploading wheels
mhucka d596aed
Tell yamllint to allow long lines in ci.yaml
mhucka 0880f22
Install yamllint
mhucka 6778901
Specify the version of yamllint
mhucka c781bb6
Don't npm-install things globally
mhucka b9f4527
Skip macos-15-intel for now
mhucka 9a3add2
Try to resolve -fopenmp on Mac
mhucka a9e4c56
Fix incorrect brew prefix
mhucka fc1ebd8
Revise & improve caching and add a bazel version parameter
mhucka e85131c
Fix syntax
mhucka 71a357c
Only try to build pybind, not test it
mhucka 114594a
Use better job names
mhucka cbf066c
Avoid using `set(CMAKE_CXX_FLAGS ...)`
mhucka 808cedb
Try to get more diagnostic output
mhucka 267f874
Take out extra debugging bits
mhucka 231ccc6
Improve comment about the different caches
mhucka 86109a1
Improve the worfklow name
mhucka 26720db
Remove the debug output step at the end
mhucka f9d4872
Rename `set-up-bazelisk` → `set-up-bazel`
mhucka 0f0f9b3
Try a variation of cmake that may work on Windows
mhucka a6bc2a1
Add a final reporter job
mhucka 56a800c
Don't set /O2 unconditionally on Windows
mhucka a33b27f
All jobs that use Bazel should depend on bazel-lint
mhucka 9e13fe0
Remove dependence on docker-test from some jobs
mhucka e2cc92a
Adjust more job dependencies
mhucka e7ab940
Merge python-lint and python-format jobs
mhucka aadcd6d
Simplify test logic in report-results job
mhucka 2589dc6
Print success or failure messages in the job summary
mhucka 0b81d4c
Try get yamllint via apt for speed
mhucka c60c9b8
Add a missing condition
mhucka 92ab9cd
Try to add some parallelism to the docker-tests job
mhucka ff19378
Remove release_wheels.yml
mhucka 036f369
Change /O2 handling on Windows to better approach
mhucka d2a8e16
Add -j to cmake build
mhucka 97c4700
Correct a comment in library-tests
mhucka 8bbc2a4
Streamline some pip install commands
mhucka 5d6dc93
Avoid need for Mac runner to run hadolint
mhucka d32b6ee
Update .github/actions/set-up-bazel/action.yaml
mhucka 484d498
`if: always()` does not need quotes
mhucka 51f6fcc
Check/lint all files, not changed files
mhucka 1b03441
Actionlint fails on ubuntu-slim, so try ubuntu-24.04
mhucka ec1035f
Try using different flags to actionlint
mhucka f39292e
Docker apparently is not available on ubuntu-slim
mhucka 30039cc
Pin action version
mhucka fde9168
Remove use of Flynt problem matcher
mhucka 6a4c008
Fix #930: add a `.gemini/styleguide.md` for Gemini Code Assist (#931)
mhucka 432ddcc
Add debug flags to cmake invocations
mhucka 1619753
Remove references to files that don't exist yet
mhucka d9ce342
Remove no-longer-relevant `base_sha` input parameter
mhucka 27e2e7b
Add option for soft linting
mhucka 1ef6621
Improve hadolint problem matcher
mhucka 32a22f2
Fix docker-lint job to use a better approach
mhucka 68d439f
Merge branch 'main' into mh-new-ci
mhucka 2bec545
Merge branch 'main' into mh-new-ci
mhucka debe959
Merge branch 'main' into mh-new-ci
mhucka 54b80a8
Replace Black problem matcher with improved one
mhucka db11152
Speed up python-checks by not installing all requirements
mhucka bc2ecca
Revert Black problem matcher
mhucka 4a50c16
Add a warning at the end if soft linting is in effect
mhucka 9d9e85f
Apply suggestion from @pavoljuhas
mhucka 4f1853e
Merge branch 'main' into mh-new-ci
mhucka 2150a8b
Avoid hard-coding requirements
mhucka 894f86a
Merge branch 'main' into mh-new-ci
mhucka 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 |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # Copyright 2025 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # https://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| # Summary: config actionlint (https://github.com/rhysd/actionlint) for certain | ||
| # things we use. | ||
|
|
||
| self-hosted-runner: | ||
| # We don't have self-hosted runners, but we do use some of the "partner" | ||
| # runner images from https://github.com/actions/partner-runner-images | ||
| # and some runners that actionlint doesn't currently recognize. | ||
| labels: | ||
| - ubuntu-24.04-arm | ||
| - ubuntu-slim |
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,107 @@ | ||
| # Copyright 2025 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # https://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| name: Set up Bazel with caching | ||
| description: Installs Bazel and sets up multiple caches | ||
|
|
||
| # Summary: reusable workflow to install Bazelisk (for Bazel) and set up Bazel | ||
| # caches. It grew out of trouble getting the existing bazel-contrib/setup-bazel | ||
| # action (from the GitHub Marketplace) to work with Netkos' "act". | ||
|
|
||
| inputs: | ||
| debug: | ||
| description: 'Run with debugging options' | ||
| type: boolean | ||
| required: false | ||
| default: true | ||
| bazel-version: | ||
| description: 'Version of Bazel to use:' | ||
| type: string | ||
| required: false | ||
| default: '' | ||
|
|
||
| permissions: | ||
| actions: write | ||
| contents: read | ||
|
|
||
| runs: | ||
| using: 'composite' | ||
| steps: | ||
| - name: Determine the version of Bazel to use | ||
| shell: bash | ||
| env: | ||
| SHELLOPTS: ${{(inputs.debug || runner.debug) && 'xtrace' || ''}} | ||
| run: | | ||
| if [[ -n "${{inputs.bazel-version}}" ]]; then | ||
| version="${{inputs.bazel-version}}" | ||
| elif [[ -f ".bazelversion" ]]; then | ||
| version="$(cat .bazelversion | tr -d ' \n\r')" | ||
| else | ||
| echo "::error::Bazel version has not been specified." | ||
| exit 1 | ||
| fi | ||
| # This variable is read by Bazelisk. | ||
| echo "USE_BAZEL_VERSION=${version}" >> "$GITHUB_ENV" | ||
|
|
||
| - name: Install Bazelisk | ||
| env: | ||
| BAZELISK_SHOW_PROGRESS: ${{inputs.debug || runner.debug}} | ||
| shell: bash | ||
| run: npm install @bazel/bazelisk | ||
|
|
||
| # This cache stores copies of Bazel downloaded by Bazelisk. The copies are | ||
| # stored in subdirs coded by hash numbers, and thus this cache can be | ||
| # shared between workflows. | ||
| - name: Set up cache for Bazelisk | ||
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 | ||
| with: | ||
| path: ~/.cache/bazelisk | ||
| key: bazelisk-cache | ||
|
|
||
| # This cache stores downloaded files (like .zip, .tar.gz) specified by | ||
| # repository rules like http_archive. This can be shared between workflows. | ||
| - name: Set up Bazel repository cache | ||
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 | ||
| with: | ||
| path: ~/.cache/bazel/repository_cache | ||
| key: bazel-repo-${{env.USE_BAZEL_VERSION}} | ||
| restore-keys: bazel-repo- | ||
|
|
||
| # This cache stores the compiled outputs of build actions, such as object | ||
| # files (.o), linked libraries (.so), binaries, & test results. | ||
| - name: Set up Bazel disk cache | ||
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 | ||
| with: | ||
| path: ~/.cache/bazel/disk_cache | ||
| # yamllint disable-line rule:line-length | ||
| key: bazel-disk-${{runner.os}}-${{runner.arch}}-${{github.ref}}-${{hashFiles('**/WORKSPACE', '**/BUILD', '**/BUILD.tpl', '**/*.bzl')}} | ||
| restore-keys: bazel-disk-${{runner.os}}-${{runner.arch}}-${{github.ref}}- | ||
|
|
||
| - name: Add configuration settings to .bazelrc | ||
| shell: bash | ||
| env: | ||
| SHELLOPTS: ${{(inputs.debug || runner.debug) && 'xtrace' || ''}} | ||
| run: | | ||
| if [[ "${{startsWith(runner.os, 'win')}}" == "true" ]]; then | ||
| num_cpus=${NUMBER_OF_PROCESSORS} | ||
| else | ||
| num_cpus=$(getconf _NPROCESSORS_ONLN) | ||
| fi | ||
| { | ||
| echo "startup --output_base=~/.cache/bazel/output_base" | ||
| echo "build --disk_cache=~/.cache/bazel/disk_cache" | ||
| echo "build --repository_cache=~/.cache/bazel/repository_cache" | ||
| echo "build --jobs=${num_cpus}" | ||
| echo "test --cache_test_results=no" | ||
| } >> .bazelrc | ||
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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.