-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix:fix CI #2924
fix:fix CI #2924
Conversation
WalkthroughThe pull request modifies the GitHub Actions workflow for the Pika project, enhancing clarity and consistency in naming conventions and the build process across environments. The workflow name changes from "Pika" to "Pika CI Pipeline." The Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant GitHub Actions
participant Docker
User->>GitHub Actions: Trigger build
GitHub Actions->>GitHub Actions: Run build_on_ubuntu
GitHub Actions->>GitHub Actions: Run build_on_rocky
GitHub Actions->>GitHub Actions: Run build_on_macos
GitHub Actions->>GitHub Actions: Run build_pika_image
GitHub Actions->>Docker: Build Docker image
Docker-->>GitHub Actions: Image built successfully
GitHub Actions-->>User: Build completed
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (1)
.github/workflows/pika.yml (1)
Line range hint
206-238
: LGTM: New Docker image build jobThe new
build_pika_image
job is well-structured and follows best practices for building Docker images in GitHub Actions. It correctly depends on thebuild_on_ubuntu
job and uses appropriate actions for Docker-related tasks.Consider adding a step to verify the existence of the Dockerfile before building:
- name: Verify Dockerfile exists run: | if [ ! -f ./ci/Dockerfile ]; then echo "Error: Dockerfile not found at ./ci/Dockerfile" exit 1 fiThis will provide a clearer error message if the Dockerfile is missing or misplaced.
🧰 Tools
🪛 actionlint
19-19: label "ubuntu22" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-22.04", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-14.0", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "macos-13.0", "macos-12-xl", "macos-12-xlarge", "macos-12-large", "macos-12", "macos-12.0", "macos-11", "macos-11.0", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file
(runner-label)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- .github/workflows/pika.yml (1 hunks)
🧰 Additional context used
🪛 actionlint
.github/workflows/pika.yml
19-19: label "ubuntu22" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-22.04", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-14.0", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "macos-13.0", "macos-12-xl", "macos-12-xlarge", "macos-12-large", "macos-12", "macos-12.0", "macos-11", "macos-11.0", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file
(runner-label)
🔇 Additional comments (1)
.github/workflows/pika.yml (1)
Line range hint
1-238
: Summary of changes to the Pika workflowThe changes to this workflow file aim to improve the build process by specifying a particular Ubuntu version and adding Docker image building capabilities. However, there's a critical issue with the Ubuntu runner label that needs to be addressed. The new Docker build job is well-implemented and will be beneficial for the project.
Key points:
- The
build_on_ubuntu
job needs to use a valid runner label.- The new
build_pika_image
job is a good addition to the workflow.Please address the invalid runner label issue, and consider the suggested improvement for the Docker build job. Once these changes are made, the workflow should be more robust and provide additional functionality with the Docker image build.
🧰 Tools
🪛 actionlint
19-19: label "ubuntu22" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-22.04", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-14.0", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "macos-13.0", "macos-12-xl", "macos-12-xlarge", "macos-12-large", "macos-12", "macos-12.0", "macos-11", "macos-11.0", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file
(runner-label)
.github/workflows/pika.yml
Outdated
@@ -16,7 +16,7 @@ jobs: | |||
# The CMake configure and build commands are platform-agnostic and should work equally well on Windows or Mac. | |||
# You can convert this to a matrix build if you need cross-platform coverage. | |||
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix | |||
runs-on: ubuntu-latest | |||
runs-on: ubuntu22 |
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.
Fix invalid runner label for Ubuntu job
The runs-on
attribute for the build_on_ubuntu
job has been changed to ubuntu22
, which is not a valid GitHub Actions runner label. This will cause the workflow to fail.
Please update the runner label to a valid Ubuntu version. For Ubuntu 22.04, use:
- runs-on: ubuntu22
+ runs-on: ubuntu-22.04
Alternatively, if you want to use the latest Ubuntu version, you can keep using ubuntu-latest
.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
runs-on: ubuntu22 | |
runs-on: ubuntu-22.04 |
🧰 Tools
🪛 actionlint
19-19: label "ubuntu22" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-22.04", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-14.0", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "macos-13.0", "macos-12-xl", "macos-12-xlarge", "macos-12-large", "macos-12", "macos-12.0", "macos-11", "macos-11.0", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file
(runner-label)
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (4)
.github/workflows/pika.yml (4)
Line range hint
25-73
: Improvements in thebuild_on_ubuntu
jobThe changes in this job enhance readability and consistency:
- Step names are more descriptive and follow a consistent pattern.
- The dependency installation now includes an explicit
apt-get update
, which is a good practice to ensure up-to-date package information.- The CMake configuration and build steps use multi-line commands for better readability.
These improvements make the workflow more maintainable and easier to understand.
However, there's a potential issue with shell scripting:
Consider quoting variables in shell commands
In several shell commands (lines 36, 44, 60), variables like
$BUILD_TYPE
are not quoted. This could lead to word splitting or globbing if the variable contains spaces or special characters. Consider updating these lines to use double quotes around the variables.For example, change:
run: cmake --build build --config $BUILD_TYPEto:
run: cmake --build build --config "$BUILD_TYPE"This change should be applied to all similar occurrences in the file.
🧰 Tools
🪛 actionlint
36-36: shellcheck reported issue in this script: SC2086:info:1:35: Double quote to prevent globbing and word splitting
(shellcheck)
44-44: shellcheck reported issue in this script: SC2086:info:1:30: Double quote to prevent globbing and word splitting
(shellcheck)
60-60: shellcheck reported issue in this script: SC2086:info:1:10: Double quote to prevent globbing and word splitting
(shellcheck)
Line range hint
90-133
: Improvements in thebuild_on_rocky
jobThe changes in this job mirror the improvements made in the
build_on_ubuntu
job:
- Step names are more descriptive and consistent.
- The dependency installation uses
dnf
, which is appropriate for Rocky Linux 9.- The CMake configuration and build steps use multi-line commands for better readability.
These changes enhance the maintainability and clarity of the workflow.
Reminder: Quote variables in shell commands
As mentioned in the
build_on_ubuntu
job, remember to quote variables in shell commands (e.g., lines 108, 112, 121) to prevent potential issues with word splitting or globbing.🧰 Tools
🪛 actionlint
107-107: shellcheck reported issue in this script: SC2086:info:1:35: Double quote to prevent globbing and word splitting
(shellcheck)
111-111: shellcheck reported issue in this script: SC2086:info:1:30: Double quote to prevent globbing and word splitting
(shellcheck)
121-121: shellcheck reported issue in this script: SC2086:info:1:10: Double quote to prevent globbing and word splitting
(shellcheck)
Line range hint
155-193
: Improvements in thebuild_on_macos
jobThe changes in this job are consistent with the improvements in the other jobs:
- Step names are more descriptive and follow a consistent pattern.
- The dependency installation now includes
brew update
, ensuring up-to-date package information.- The CMake configuration and build steps use multi-line commands for better readability.
- The C compiler is explicitly set to gcc-10, which provides better control over the build environment.
These changes enhance the maintainability and clarity of the workflow.
Reminder: Quote variables in shell commands
As mentioned in previous jobs, remember to quote variables in shell commands (e.g., lines 166, 171, 181) to prevent potential issues with word splitting or globbing.
🧰 Tools
🪛 actionlint
166-166: shellcheck reported issue in this script: SC2086:info:2:78: Double quote to prevent globbing and word splitting
(shellcheck)
171-171: shellcheck reported issue in this script: SC2086:info:1:30: Double quote to prevent globbing and word splitting
(shellcheck)
181-181: shellcheck reported issue in this script: SC2086:info:1:10: Double quote to prevent globbing and word splitting
(shellcheck)
Line range hint
205-238
: Newbuild_pika_image
job adds valuable functionalityThe addition of the
build_pika_image
job is a great improvement to the CI pipeline:
- It ensures that a Docker image can be built successfully after the Ubuntu build.
- It uses standard Docker GitHub Actions, following best practices.
- The image is built but not pushed, which is appropriate for PR checks.
- It downloads the artifact from the
build_on_ubuntu
job, ensuring consistency between the built binary and the Docker image.This new job will help catch any issues with Docker image creation early in the development process.
Suggestion: Consider adding a comment explaining the purpose of this job
To improve maintainability, consider adding a comment before the job definition explaining its purpose and its relationship to the other jobs in the workflow. For example:
# This job builds a Docker image for Pika using the artifact from the Ubuntu build. # It ensures that the Docker image can be created successfully but does not push it. build_pika_image: name: Build Pika Docker Image runs-on: ubuntu-latest needs: build_on_ubuntuThis comment would help future maintainers understand the job's role in the CI pipeline more quickly.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- .github/workflows/pika.yml (7 hunks)
🧰 Additional context used
🪛 actionlint
.github/workflows/pika.yml
36-36: shellcheck reported issue in this script: SC2086:info:1:35: Double quote to prevent globbing and word splitting
(shellcheck)
44-44: shellcheck reported issue in this script: SC2086:info:1:30: Double quote to prevent globbing and word splitting
(shellcheck)
60-60: shellcheck reported issue in this script: SC2086:info:1:10: Double quote to prevent globbing and word splitting
(shellcheck)
107-107: shellcheck reported issue in this script: SC2086:info:1:35: Double quote to prevent globbing and word splitting
(shellcheck)
111-111: shellcheck reported issue in this script: SC2086:info:1:30: Double quote to prevent globbing and word splitting
(shellcheck)
121-121: shellcheck reported issue in this script: SC2086:info:1:10: Double quote to prevent globbing and word splitting
(shellcheck)
166-166: shellcheck reported issue in this script: SC2086:info:2:78: Double quote to prevent globbing and word splitting
(shellcheck)
171-171: shellcheck reported issue in this script: SC2086:info:1:30: Double quote to prevent globbing and word splitting
(shellcheck)
181-181: shellcheck reported issue in this script: SC2086:info:1:10: Double quote to prevent globbing and word splitting
(shellcheck)
🔇 Additional comments (3)
.github/workflows/pika.yml (3)
1-1
: Workflow name change improves clarityThe change from "Pika" to "Pika CI Pipeline" provides a more descriptive name for the workflow, clearly indicating its purpose as a CI pipeline. This is a good improvement for maintainability.
5-7
: Formatting improvement in theon
sectionThe removal of extra spaces in the
on
section improves the consistency of the YAML formatting. This change enhances readability without affecting the workflow's functionality.
Line range hint
1-238
: Overall improvements to the Pika CI PipelineThe changes made to this workflow file significantly enhance the Pika CI Pipeline:
- Consistent naming conventions and formatting across all jobs improve readability and maintainability.
- Step descriptions are more detailed and accurate, making it easier to understand the purpose of each step.
- The addition of the
build_pika_image
job extends the CI pipeline to include Docker image creation, which is valuable for catching potential issues early.- The use of multi-line commands for complex operations (like CMake configuration) improves readability.
- Updates to package management commands (e.g., including
apt-get update
andbrew update
) ensure more reliable builds.These improvements will make the CI pipeline more robust and easier to maintain. However, remember to address the shell scripting issue by quoting variables in commands throughout the file.
Great work on enhancing this CI pipeline!
🧰 Tools
🪛 actionlint
36-36: shellcheck reported issue in this script: SC2086:info:1:35: Double quote to prevent globbing and word splitting
(shellcheck)
44-44: shellcheck reported issue in this script: SC2086:info:1:30: Double quote to prevent globbing and word splitting
(shellcheck)
60-60: shellcheck reported issue in this script: SC2086:info:1:10: Double quote to prevent globbing and word splitting
(shellcheck)
* fix:fix CI --------- Co-authored-by: chejinge <[email protected]>
Summary by CodeRabbit
New Features
Improvements