-
Notifications
You must be signed in to change notification settings - Fork 97
Allow to launch binaries manually #6681
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
Conversation
📝 WalkthroughWalkthroughThe pull request introduces modifications to two GitHub Actions workflows: Changes
Possibly related PRs
Suggested labels
Suggested reviewers
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
Documentation and Community
|
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 (2)
.github/workflows/build.yaml (1)
52-52
: Document the required label format in workflow commentsThe conditional execution based on the 'binary:' label is a good approach for manual control. However, it would be helpful to document the exact label format required to trigger the binary builds.
Add a comment above the job to explain the label requirement:
+ # Requires a label starting with 'binary:' to trigger the binary builds + # Example: binary:all, binary:hoprd, etc. if: contains(github.event.pull_request.labels.*.name, 'binary:').github/workflows/build-binaries.yaml (1)
Line range hint
98-101
: Fix incorrect condition for Nix installation.The condition still references the removed
runner_needs_nix_setup
input.Apply this fix:
- if: inputs.runner_needs_nix_setup == true + if: env.GH_RUNNER_NEEDS_NIX_SETUP == 'true'🧰 Tools
🪛 actionlint (1.7.4)
62-62: shellcheck reported issue in this script: SC1075:error:20:3: Use 'elif' instead of 'else if' (or put 'if' on new line if nesting)
(shellcheck)
62-62: shellcheck reported issue in this script: SC1009:info:20:3: The mentioned syntax error was in this else clause
(shellcheck)
62-62: shellcheck reported issue in this script: SC1046:error:20:8: Couldn't find 'fi' for this 'if'
(shellcheck)
62-62: shellcheck reported issue in this script: SC1073:error:20:8: Couldn't parse this if expression. Fix to allow more checks
(shellcheck)
62-62: shellcheck reported issue in this script: SC1075:error:23:3: Use 'elif' instead of 'else if' (or put 'if' on new line if nesting)
(shellcheck)
62-62: shellcheck reported issue in this script: SC1047:error:27:1: Expected 'fi' matching previously mentioned 'if'
(shellcheck)
62-62: shellcheck reported issue in this script: SC1072:error:27:2: Unexpected keyword/token. Fix any mentioned problems and try again
(shellcheck)
62-62: property "test_id" is not defined in object type {binary: string; runner: string; target: string}
(expression)
98-98: property "runner_needs_nix_setup" is not defined in object type {binary: string; branch: string; runner: string; target: string}
(expression)
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (2)
.github/workflows/build-binaries.yaml
(3 hunks).github/workflows/build.yaml
(1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/build-binaries.yaml
62-62: shellcheck reported issue in this script: SC1075:error:20:3: Use 'elif' instead of 'else if' (or put 'if' on new line if nesting)
(shellcheck)
62-62: shellcheck reported issue in this script: SC1009:info:20:3: The mentioned syntax error was in this else clause
(shellcheck)
62-62: shellcheck reported issue in this script: SC1046:error:20:8: Couldn't find 'fi' for this 'if'
(shellcheck)
62-62: shellcheck reported issue in this script: SC1073:error:20:8: Couldn't parse this if expression. Fix to allow more checks
(shellcheck)
62-62: shellcheck reported issue in this script: SC1075:error:23:3: Use 'elif' instead of 'else if' (or put 'if' on new line if nesting)
(shellcheck)
62-62: shellcheck reported issue in this script: SC1047:error:27:1: Expected 'fi' matching previously mentioned 'if'
(shellcheck)
62-62: shellcheck reported issue in this script: SC1072:error:27:2: Unexpected keyword/token. Fix any mentioned problems and try again
(shellcheck)
62-62: property "test_id" is not defined in object type {binary: string; runner: string; target: string}
(expression)
🔇 Additional comments (4)
.github/workflows/build.yaml (2)
75-75
: LGTM! Clean target configuration
The simplified target reference without package_suffix makes the configuration cleaner and more maintainable.
58-67
: Verify runner capabilities for all architectures
The matrix configuration covers a good range of architectures. Let's verify the runner capabilities to ensure successful builds.
✅ Verification successful
Runner configuration is well-defined and consistent
The matrix configuration for runners is properly aligned with the build requirements:
- Linux builds (x86_64, aarch64, armv7l) use self-hosted-hoprnet-bigger runners
- macOS builds use appropriate GitHub-hosted runners (macos-14 for M1/aarch64, macos-13 for Intel/x86_64)
- Runner options are consistently defined in both the matrix and workflow_dispatch inputs
- The build-binaries workflow correctly handles the runner selection and architecture-specific configurations
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check runner labels and recent workflow runs to verify architecture support
# Check recent workflow runs for these runners
gh run list --workflow=build.yaml --json conclusion,name,headBranch,status --jq '.[] | select(.name | contains("build-binaries")) | {name: .name, conclusion: .conclusion, branch: .headBranch}' --limit 10
# List available runner labels
gh api repos/$GITHUB_REPOSITORY/actions/runners --jq '.runners[] | {name: .name, labels: .labels[].name}'
Length of output: 409
Script:
#!/bin/bash
# Let's verify the workflow configuration and runner usage patterns
# Check the workflow file content
cat .github/workflows/build.yaml
# Search for any related workflow files that might reference these runners
fd -e yaml -e yml . .github/workflows/ --exec grep -l "runner:"
# Look for any documentation about runners
fd README -t f | xargs grep -l "runner" || true
Length of output: 2786
Script:
#!/bin/bash
# Let's check the build-binaries workflow to understand runner requirements
cat .github/workflows/build-binaries.yaml
# Also check if there are any recent changes to runner configurations
fd -e yaml -e yml . .github/workflows/ --exec grep -A 5 -B 5 "runner:"
Length of output: 5087
.github/workflows/build-binaries.yaml (2)
23-50
: LGTM! Well-structured workflow_dispatch configuration.
The manual trigger configuration is well-organized with clear descriptions and appropriate choices for each input.
115-119
: LGTM! Well-structured artifact configuration.
The artifact naming and path configuration is correct and follows best practices.
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/build-binaries.yaml (1)
Line range hint
98-106
: Fix the Nix setup condition.The condition still references the removed input
runner_needs_nix_setup
. It should use the environment variable instead.Apply this fix:
- if: inputs.runner_needs_nix_setup == true + if: env.GH_RUNNER_NEEDS_NIX_SETUP == 'true'
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (2)
.github/workflows/build-binaries.yaml
(3 hunks).github/workflows/build.yaml
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/workflows/build.yaml
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/build-binaries.yaml
63-63: shellcheck reported issue in this script: SC1075:error:20:3: Use 'elif' instead of 'else if' (or put 'if' on new line if nesting)
(shellcheck)
63-63: shellcheck reported issue in this script: SC1009:info:20:3: The mentioned syntax error was in this else clause
(shellcheck)
63-63: shellcheck reported issue in this script: SC1046:error:20:8: Couldn't find 'fi' for this 'if'
(shellcheck)
63-63: shellcheck reported issue in this script: SC1073:error:20:8: Couldn't parse this if expression. Fix to allow more checks
(shellcheck)
63-63: shellcheck reported issue in this script: SC1075:error:23:3: Use 'elif' instead of 'else if' (or put 'if' on new line if nesting)
(shellcheck)
63-63: shellcheck reported issue in this script: SC1047:error:27:1: Expected 'fi' matching previously mentioned 'if'
(shellcheck)
63-63: shellcheck reported issue in this script: SC1072:error:27:2: Unexpected keyword/token. Fix any mentioned problems and try again
(shellcheck)
🔇 Additional comments (3)
.github/workflows/build-binaries.yaml (3)
23-50
: LGTM! Well-structured workflow_dispatch configuration.
The manual trigger configuration is well-defined with clear descriptions, appropriate required flags, and comprehensive options for all inputs.
51-54
: LGTM! Effective concurrency control.
The concurrency configuration properly prevents parallel builds of the same binary/target combination and efficiently manages resources by canceling outdated builds.
61-91
: Previous review comment about shell script issues is still valid.
The shell script still contains syntax errors and could benefit from the improvements suggested in the previous review.
🧰 Tools
🪛 actionlint (1.7.4)
63-63: shellcheck reported issue in this script: SC1075:error:20:3: Use 'elif' instead of 'else if' (or put 'if' on new line if nesting)
(shellcheck)
63-63: shellcheck reported issue in this script: SC1009:info:20:3: The mentioned syntax error was in this else clause
(shellcheck)
63-63: shellcheck reported issue in this script: SC1046:error:20:8: Couldn't find 'fi' for this 'if'
(shellcheck)
63-63: shellcheck reported issue in this script: SC1073:error:20:8: Couldn't parse this if expression. Fix to allow more checks
(shellcheck)
63-63: shellcheck reported issue in this script: SC1075:error:23:3: Use 'elif' instead of 'else if' (or put 'if' on new line if nesting)
(shellcheck)
63-63: shellcheck reported issue in this script: SC1047:error:27:1: Expected 'fi' matching previously mentioned 'if'
(shellcheck)
63-63: shellcheck reported issue in this script: SC1072:error:27:2: Unexpected keyword/token. Fix any mentioned problems and try again
(shellcheck)
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
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
.github/workflows/build-binaries.yaml
(3 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/build-binaries.yaml
63-63: shellcheck reported issue in this script: SC1075:error:20:3: Use 'elif' instead of 'else if' (or put 'if' on new line if nesting)
(shellcheck)
63-63: shellcheck reported issue in this script: SC1009:info:20:3: The mentioned syntax error was in this else clause
(shellcheck)
63-63: shellcheck reported issue in this script: SC1046:error:20:8: Couldn't find 'fi' for this 'if'
(shellcheck)
63-63: shellcheck reported issue in this script: SC1073:error:20:8: Couldn't parse this if expression. Fix to allow more checks
(shellcheck)
63-63: shellcheck reported issue in this script: SC1075:error:23:3: Use 'elif' instead of 'else if' (or put 'if' on new line if nesting)
(shellcheck)
63-63: shellcheck reported issue in this script: SC1047:error:27:1: Expected 'fi' matching previously mentioned 'if'
(shellcheck)
63-63: shellcheck reported issue in this script: SC1072:error:27:2: Unexpected keyword/token. Fix any mentioned problems and try again
(shellcheck)
🔇 Additional comments (3)
.github/workflows/build-binaries.yaml (3)
23-50
: LGTM! Well-structured workflow_dispatch configuration.
The manual trigger configuration is well-defined with clear descriptions, appropriate required flags, and comprehensive options for different architectures.
57-58
: The job condition needs to be fixed for workflow_dispatch events.
The current condition might cause issues as noted in the previous review.
120-126
: LGTM! Build and upload steps are properly configured.
The steps correctly use the environment variables set in previous steps.
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: 2
🧹 Outside diff range and nitpick comments (2)
.github/workflows/build-binaries.yaml (2)
23-49
: Enhance input descriptions for better clarity.The workflow_dispatch configuration is well-structured, but consider these improvements:
- The runner description only mentions macOS options but includes
self-hosted-hoprnet-bigger
- The binary options (
hoprd
andhopli
) would benefit from descriptions explaining their purposebinary: required: true - description: 'Binary to build' + description: 'Binary to build (hoprd: HOPR node daemon, hopli: HOPR command-line interface)' type: choice options: - hoprd - hopli runner: type: choice options: - self-hosted-hoprnet-bigger - macos-13 - macos-14 required: true - description: 'GH Runner to use: macos-13=x86_64-darwin and macos-14=aarch64-darwin' + description: 'GH Runner to use: self-hosted=Linux builds, macos-13=x86_64-darwin, macos-14=aarch64-darwin'
Line range hint
108-116
: Fix Nix installation condition.The Nix installation step is still using the removed input
runner_needs_nix_setup
. It should use the environment variable instead.- name: Install Nix - if: inputs.runner_needs_nix_setup == true + if: env.GH_RUNNER_NEEDS_NIX_SETUP == 'true' uses: cachix/install-nix-action@v29 with: github_access_token: ${{ secrets.GITHUB_TOKEN }} nix_path: nixpkgs=channel:nixos-24.05 - uses: cachix/cachix-action@v15 - if: env.GH_RUNNER_NEEDS_NIX_SETUP == true + if: env.GH_RUNNER_NEEDS_NIX_SETUP == 'true'
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
.github/workflows/build-binaries.yaml
(3 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/build-binaries.yaml
63-63: shellcheck reported issue in this script: SC1075:error:23:3: Use 'elif' instead of 'else if' (or put 'if' on new line if nesting)
(shellcheck)
63-63: shellcheck reported issue in this script: SC1009:info:23:3: The mentioned syntax error was in this else clause
(shellcheck)
63-63: shellcheck reported issue in this script: SC1046:error:23:8: Couldn't find 'fi' for this 'if'
(shellcheck)
63-63: shellcheck reported issue in this script: SC1073:error:23:8: Couldn't parse this if expression. Fix to allow more checks
(shellcheck)
63-63: shellcheck reported issue in this script: SC1075:error:26:3: Use 'elif' instead of 'else if' (or put 'if' on new line if nesting)
(shellcheck)
63-63: shellcheck reported issue in this script: SC1047:error:30:1: Expected 'fi' matching previously mentioned 'if'
(shellcheck)
63-63: shellcheck reported issue in this script: SC1072:error:30:2: Unexpected keyword/token. Fix any mentioned problems and try again
(shellcheck)
🔇 Additional comments (2)
.github/workflows/build-binaries.yaml (2)
51-54
: LGTM! Well-configured concurrency settings.
The concurrency configuration is properly scoped and follows best practices by canceling redundant runs.
Line range hint 123-131
: LGTM! Well-structured build and upload steps.
The build and upload steps are properly configured with clear artifact naming and correct use of environment variables.
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 (1)
.github/workflows/build-binaries.yaml (1)
Line range hint
110-117
: Fix inconsistent Nix setup conditions.The conditions for Nix setup are inconsistent:
- Install Nix step uses
inputs.runner_needs_nix_setup
- Cachix step uses
env.GH_RUNNER_NEEDS_NIX_SETUP
This could lead to unexpected behavior where Nix is installed but Cachix is not configured, or vice versa.
Apply this fix:
- - name: Install Nix - if: inputs.runner_needs_nix_setup == true + - name: Install Nix + if: env.GH_RUNNER_NEEDS_NIX_SETUP == 'true'
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
.github/workflows/build-binaries.yaml
(3 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/build-binaries.yaml
63-63: shellcheck reported issue in this script: SC1075:error:24:3: Use 'elif' instead of 'else if' (or put 'if' on new line if nesting)
(shellcheck)
63-63: shellcheck reported issue in this script: SC1009:info:24:3: The mentioned syntax error was in this else clause
(shellcheck)
63-63: shellcheck reported issue in this script: SC1046:error:24:8: Couldn't find 'fi' for this 'if'
(shellcheck)
63-63: shellcheck reported issue in this script: SC1073:error:24:8: Couldn't parse this if expression. Fix to allow more checks
(shellcheck)
63-63: shellcheck reported issue in this script: SC1075:error:27:3: Use 'elif' instead of 'else if' (or put 'if' on new line if nesting)
(shellcheck)
63-63: shellcheck reported issue in this script: SC1047:error:31:1: Expected 'fi' matching previously mentioned 'if'
(shellcheck)
63-63: shellcheck reported issue in this script: SC1072:error:31:2: Unexpected keyword/token. Fix any mentioned problems and try again
(shellcheck)
🔇 Additional comments (4)
.github/workflows/build-binaries.yaml (4)
23-50
: LGTM! Well-structured workflow_dispatch configuration.
The manual trigger configuration is well-designed with:
- Clear input descriptions
- Proper validation through choice constraints
- Logical grouping of runner and target architecture options
57-58
: Fix job condition and runner selection.
This issue was previously identified but hasn't been fully addressed. Please refer to the previous review comment for the detailed fix:
#6681 (comment)
61-102
: Fix shell script syntax and improve error handling.
These issues were previously identified but haven't been fully addressed. Please refer to the previous review comment for the detailed fix:
#6681 (comment)
🧰 Tools
🪛 actionlint (1.7.4)
63-63: shellcheck reported issue in this script: SC1075:error:24:3: Use 'elif' instead of 'else if' (or put 'if' on new line if nesting)
(shellcheck)
63-63: shellcheck reported issue in this script: SC1009:info:24:3: The mentioned syntax error was in this else clause
(shellcheck)
63-63: shellcheck reported issue in this script: SC1046:error:24:8: Couldn't find 'fi' for this 'if'
(shellcheck)
63-63: shellcheck reported issue in this script: SC1073:error:24:8: Couldn't parse this if expression. Fix to allow more checks
(shellcheck)
63-63: shellcheck reported issue in this script: SC1075:error:27:3: Use 'elif' instead of 'else if' (or put 'if' on new line if nesting)
(shellcheck)
63-63: shellcheck reported issue in this script: SC1047:error:31:1: Expected 'fi' matching previously mentioned 'if'
(shellcheck)
63-63: shellcheck reported issue in this script: SC1072:error:31:2: Unexpected keyword/token. Fix any mentioned problems and try again
(shellcheck)
124-131
: LGTM! Well-configured build and upload steps.
The build and upload steps are properly configured with:
- Consistent use of environment variables
- Proper artifact naming and paths
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 (2)
.github/workflows/build-binaries.yaml (2)
25-49
: Enhance input descriptions for better clarity.The workflow_dispatch inputs could be more descriptive:
- For
binary
input, include brief descriptions of what each binary does (hoprd/hopli)- For
target
input, consider grouping options by platform (Linux/Darwin) for better organizationbinary: required: true - description: 'Binary to build' + description: 'Binary to build (hoprd: HOPR node daemon, hopli: HOPR CLI tool)' type: choice options: - hoprd - hopli target: type: choice options: + # Linux targets - x86_64-linux - aarch64-linux - armv7l-linux + # Darwin targets - x86_64-darwin - aarch64-darwin required: true - description: 'Architecture to build for' + description: 'Target architecture and platform to build for (Linux/Darwin)'
123-124
: Add error handling for build step.The build step should include error handling to ensure failures are properly caught and reported.
- name: Build ${{ steps.vars.outputs.binary }} binaries - run: nix build .#${{ steps.vars.outputs.binary }}${{ steps.vars.outputs.package_suffix }} -L + run: | + set -eo pipefail + if ! nix build .#${{ steps.vars.outputs.binary }}${{ steps.vars.outputs.package_suffix }} -L; then + echo "::error::Failed to build ${{ steps.vars.outputs.binary }} for ${{ steps.vars.outputs.target }}" + exit 1 + fi
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
.github/workflows/build-binaries.yaml
(2 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/build-binaries.yaml
63-63: shellcheck reported issue in this script: SC1075:error:17:1: Use 'elif' instead of 'else if' (or put 'if' on new line if nesting)
(shellcheck)
63-63: shellcheck reported issue in this script: SC1009:info:17:1: The mentioned syntax error was in this else clause
(shellcheck)
63-63: shellcheck reported issue in this script: SC1046:error:17:6: Couldn't find 'fi' for this 'if'
(shellcheck)
63-63: shellcheck reported issue in this script: SC1073:error:17:6: Couldn't parse this if expression. Fix to allow more checks
(shellcheck)
63-63: shellcheck reported issue in this script: SC1075:error:20:1: Use 'elif' instead of 'else if' (or put 'if' on new line if nesting)
(shellcheck)
63-63: shellcheck reported issue in this script: SC1047:error:39:1: Expected 'fi' matching previously mentioned 'if'
(shellcheck)
63-63: shellcheck reported issue in this script: SC1072:error:39:1: Expected 'fi'. Fix any mentioned problems and try again
(shellcheck)
🔇 Additional comments (1)
.github/workflows/build-binaries.yaml (1)
57-58
: Referencing existing review comment.
This issue was already identified in a previous review. Please refer to the existing comment about fixing the job condition and simplifying runner selection.
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/build-binaries.yaml (1)
123-124
: Add error handling for the build step.The build step should handle potential failures gracefully and provide clear error messages.
- name: Build ${{ steps.vars.outputs.binary }} binaries run: | + set -eo pipefail + echo "::group::Building ${{ steps.vars.outputs.binary }}" nix build .#${{ steps.vars.outputs.binary }}${{ steps.vars.outputs.package_suffix }} -L + if [ ! -d "result/bin" ]; then + echo "::error::Build failed: Binary not found in result/bin" + exit 1 + fi + echo "::endgroup::"
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
.github/workflows/build-binaries.yaml
(2 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/build-binaries.yaml
63-63: shellcheck reported issue in this script: SC2086:info:30:6: Double quote to prevent globbing and word splitting
(shellcheck)
🔇 Additional comments (2)
.github/workflows/build-binaries.yaml (2)
23-50
: LGTM! Well-structured workflow_dispatch configuration.
The manual trigger is well-defined with appropriate input validations and clear descriptions.
57-58
: 🛠️ Refactor suggestion
Improve job condition and runner selection.
The current implementation can be improved for better clarity and reliability:
- The condition should explicitly handle workflow_dispatch events
- The runner selection can be simplified
- if: contains(github.event.pull_request.labels.*.name, format('binary:{0}', inputs.target)) || github.event.inputs.binary
- runs-on: ${{ inputs.runner || github.event.inputs.runner }}
+ if: github.event_name == 'workflow_dispatch' || (github.event_name == 'workflow_call' && contains(github.event.pull_request.labels.*.name, format('binary:{0}', inputs.target)))
+ runs-on: ${{ github.event.inputs.runner || inputs.runner }}
Likely invalid or redundant comment.
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: 2
🧹 Outside diff range and nitpick comments (2)
.github/workflows/build-binaries.yaml (2)
25-49
: Enhance input descriptions for better clarity.Consider adding more detailed descriptions:
- For the
binary
input, describe what each option represents- For the
runner
input, make the architecture mapping more explicitbinary: required: true - description: 'Binary to build' + description: 'Binary to build: hoprd (node daemon) or hopli (command-line interface)' type: choice options: - hoprd - hopli runner: type: choice options: - self-hosted-hoprnet-bigger - macos-13 - macos-14 required: true - description: 'GH Runner to use: macos-13=x86_64-darwin and macos-14=aarch64-darwin' + description: 'Runner to use: self-hosted-hoprnet-bigger (Linux), macos-13 (x86_64-darwin), macos-14 (aarch64-darwin)'
102-117
: Enhance build steps with timeouts and error handling.Consider adding:
- Timeout for Nix installation
- Error handling for the build step
- Build status verification
- name: Install Nix if: steps.vars.outputs.runner_needs_nix_setup == 'true' uses: cachix/install-nix-action@v29 + timeout-minutes: 5 with: github_access_token: ${{ secrets.GITHUB_TOKEN }} nix_path: nixpkgs=channel:nixos-24.05 - uses: cachix/cachix-action@v15 if: steps.vars.outputs.runner_needs_nix_setup == 'true' + timeout-minutes: 5 with: name: hoprnet authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" env: USER: runner - name: Build ${{ steps.vars.outputs.binary }} binaries - run: nix build .#${{ steps.vars.outputs.binary }}${{ steps.vars.outputs.package_suffix }} -L + run: | + set -eo pipefail + nix build .#${{ steps.vars.outputs.binary }}${{ steps.vars.outputs.package_suffix }} -L + if [ ! -f "result/bin/${{ steps.vars.outputs.binary }}" ]; then + echo "::error::Build failed: Binary not found at expected location" + exit 1 + fi
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
.github/workflows/build-binaries.yaml
(2 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/build-binaries.yaml
63-63: shellcheck reported issue in this script: SC2086:info:25:34: Double quote to prevent globbing and word splitting
(shellcheck)
63-63: shellcheck reported issue in this script: SC2086:info:26:34: Double quote to prevent globbing and word splitting
(shellcheck)
63-63: shellcheck reported issue in this script: SC2086:info:27:34: Double quote to prevent globbing and word splitting
(shellcheck)
63-63: shellcheck reported issue in this script: SC2086:info:28:50: Double quote to prevent globbing and word splitting
(shellcheck)
63-63: shellcheck reported issue in this script: SC2086:info:29:66: Double quote to prevent globbing and word splitting
(shellcheck)
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/build-binaries.yaml (1)
105-109
: Consider making Nix path configurable.The Nix path is hardcoded to
nixos-24.05
. Consider making it configurable through workflow inputs or repository variables for better maintainability.- name: Install Nix if: steps.vars.outputs.runner_needs_nix_setup == 'true' uses: cachix/install-nix-action@v29 with: github_access_token: ${{ secrets.GITHUB_TOKEN }} - nix_path: nixpkgs=channel:nixos-24.05 + nix_path: nixpkgs=channel:${{ vars.NIX_CHANNEL || 'nixos-24.05' }}
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
.github/workflows/build-binaries.yaml
(2 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/build-binaries.yaml
63-63: shellcheck reported issue in this script: SC2086:info:28:34: Double quote to prevent globbing and word splitting
(shellcheck)
63-63: shellcheck reported issue in this script: SC2086:info:29:34: Double quote to prevent globbing and word splitting
(shellcheck)
63-63: shellcheck reported issue in this script: SC2086:info:30:34: Double quote to prevent globbing and word splitting
(shellcheck)
63-63: shellcheck reported issue in this script: SC2086:info:31:50: Double quote to prevent globbing and word splitting
(shellcheck)
63-63: shellcheck reported issue in this script: SC2086:info:32:66: Double quote to prevent globbing and word splitting
(shellcheck)
🔇 Additional comments (2)
.github/workflows/build-binaries.yaml (2)
57-58
:
Improve job condition robustness.
The current condition may fail when accessing github.event.pull_request.labels
during workflow_dispatch events. Consider using event-specific conditions.
- if: contains(github.event.pull_request.labels.*.name, format('binary:{0}', inputs.target)) || github.event.inputs.binary
- runs-on: ${{ inputs.runner || github.event.inputs.runner }}
+ if: >-
+ (github.event_name == 'workflow_dispatch' && github.event.inputs.binary != '') ||
+ (github.event_name == 'workflow_call' && inputs.target != '' && contains(github.event.pull_request.labels.*.name, format('binary:{0}', inputs.target)))
+ runs-on: ${{ github.event.inputs.runner || inputs.runner }}
Likely invalid or redundant comment.
32-49
: Verify runner-target compatibility.
The runner options don't cover all possible target architectures. For example, there's no runner option specified for armv7l-linux
target. This mismatch could lead to build failures.
All binaries are available at this workflow |
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: 2
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
.github/workflows/build-binaries.yaml
(2 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/build-binaries.yaml
65-65: shellcheck reported issue in this script: SC2086:info:32:34: Double quote to prevent globbing and word splitting
(shellcheck)
65-65: shellcheck reported issue in this script: SC2086:info:33:34: Double quote to prevent globbing and word splitting
(shellcheck)
65-65: shellcheck reported issue in this script: SC2086:info:34:34: Double quote to prevent globbing and word splitting
(shellcheck)
65-65: shellcheck reported issue in this script: SC2086:info:35:50: Double quote to prevent globbing and word splitting
(shellcheck)
65-65: shellcheck reported issue in this script: SC2086:info:36:66: Double quote to prevent globbing and word splitting
(shellcheck)
🔇 Additional comments (2)
.github/workflows/build-binaries.yaml (2)
23-49
: LGTM! Well-structured workflow_dispatch configuration.
The manual trigger configuration is well-designed with:
- Clear descriptions for each input
- Appropriate required flags
- Comprehensive options for different architectures and runners
104-132
: LGTM! Well-structured build steps configuration.
The build steps are properly configured with:
- Appropriate use of environment variables from the vars step
- Conditional Nix installation based on runner type
- Proper artifact upload configuration
Deploy where? |
The binaries are just compiled and published in the workflow run. We still don't have an environment specified for those binaries. |
Allow to generate the
hopli
andhoprd
binaries from a manual workflow and select a branch.