-
Notifications
You must be signed in to change notification settings - Fork 426
ci: refactor the workflows to unblock faster runners #2182
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
🔍 Suggested ReviewersBased on git blame analysis of the changed lines, the following contributors have significant experience with the modified code:
Please consider reviewing this PR as you have authored significant portions of the code being modified. Your expertise would be valuable! 🙏 This comment was automatically generated by git-blame-auto-reviewer Last updated: 2025-09-25T01:09:24.279Z |
Claude finished @sandydoo's task —— View job PR Review: CI Workflow RefactoringI've completed my analysis of the GitHub Actions workflow refactoring. Here's my detailed feedback focusing on areas for improvement: Todo List:
Key Issues and Recommendations1. Complex Matrix Logic DuplicationThe system matrix selection logic is duplicated across all workflow files ( # Repeated in build.yml, examples.yml, test.yml, pr-test.yml
systems: >-
${{
inputs.system && fromJSON(format('[{0}]',
inputs.system == 'aarch64-linux' && '{"system": "aarch64-linux", "runs-on": ["self-hosted", "linux", "ARM64"]}' ||
# ... more conditions
)) || fromJSON('[...full matrix...]')
}} Issues:
Recommendation: Create a composite action or move this logic to a central location. Consider: # .github/actions/get-matrix/action.yml
name: 'Get System Matrix'
inputs:
system:
description: 'Optional system filter'
required: false
outputs:
matrix:
description: 'System matrix JSON'
value: ${{ steps.matrix.outputs.result }}
runs:
using: 'composite'
steps:
- id: matrix
# Centralized logic here 2. Inconsistent Spacing in YAMLThere are inconsistent spacing patterns in the # Line 35: Missing space
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.ref || ''}}
# Line 51: Proper spacing
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.ref || '' }} Recommendation: Use consistent spacing throughout. Consider adding a YAML linter to your CI. 3. Per-System Job Chain ComplexityThe new approach in build-aarch64-linux -> test-aarch64-linux -> examples-aarch64-linux
build-x86_64-linux -> test-x86_64-linux -> examples-x86_64-linux
# etc... Potential Issues:
Recommendations:
jobs:
build-aarch64-linux:
timeout-minutes: 30 # Add appropriate timeouts 4. Missing Error Handling for External DependenciesIn json=$(nix shell nixpkgs#tree -c tree -J -L 1 examples | nix shell nixpkgs#jq -c jq -c '[.[0].contents[] | .name]') Issues:
Recommendation: Add error checking and break down the command: - name: Fetch examples to run
id: set-examples
run: |
set -euxo pipefail
if [[ ! -d examples ]]; then
echo "examples=[]" >> $GITHUB_OUTPUT
exit 0
fi
tree_output=$(nix shell nixpkgs#tree -c tree -J -L 1 examples)
json=$(echo "$tree_output" | nix shell nixpkgs#jq -c jq -c '[.[0].contents[] | .name]')
echo "examples=$json" >> $GITHUB_OUTPUT 5. Resource Optimization OpportunitiesCurrent approach: Examples always run with Recommendation: Consider using 6. Security ConsiderationsToken usage: Minor improvement: In authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" # Quoted
# vs elsewhere:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} # Unquoted Both work, but consistency would be better. 7. Performance AnalysisPositive changes:
Potential concerns:
Overall AssessmentThe refactoring achieves its goal of unblocking faster runners through better parallelization. The architectural changes are sound, but the implementation could be more maintainable and robust. Priority improvements:
|
Deploying devenv with
|
Latest commit: |
24ad0ce
|
Status: | ✅ Deploy successful! |
Preview URL: | https://a5148779.devenv.pages.dev |
Branch Preview URL: | https://ci-faster.devenv.pages.dev |
No description provided.