-
Notifications
You must be signed in to change notification settings - Fork 5
⚗️ test new reusable workflow #121
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
WalkthroughThis update refactors the GitHub Actions pipeline by replacing inline job steps for Linux and Windows preparation with reusable workflow calls. It standardizes output variable naming conventions, updates reusable workflow versions for build, pack, and test jobs, removes an unused input from the pack job, and modifies the deployment job's dependencies to include integration tests. The integration_test job now explicitly restores cache and downloads artifacts, and updates the dotnet-test action version. Changes
Sequence Diagram(s)sequenceDiagram
participant Developer
participant GitHub Actions
participant ReusableWorkflow
participant IntegrationTest
Developer->>GitHub Actions: Push code / open PR
GitHub Actions->>ReusableWorkflow: Run prepare_linux (use-restore-cache: true)
GitHub Actions->>ReusableWorkflow: Run prepare_windows (use-restore-cache: true, runs-on: windows-2022)
GitHub Actions->>GitHub Actions: Run build, pack, test, sonarcloud, codecov, codeql
GitHub Actions->>IntegrationTest: Run integration_test
GitHub Actions->>GitHub Actions: Deploy (after build, pack, test, integration_test, sonarcloud, codecov, codeql complete)
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/pipelines.yml
(6 hunks)
🔇 Additional comments (6)
.github/workflows/pipelines.yml (6)
26-29
: Simplified Linux restore job with reusable workflow
Theprepare_linux
job now uses the centralizedjobs-dotnet-restore
workflow, eliminating duplicated checkout/install/restore steps. This improves maintainability and consistency.
32-36
: Simplified Windows restore job with reusable workflow
Similarly, theprepare_windows
job delegates to the same reusable workflow. By passingruns-on: windows-2022
as an input override, you maintain parity with the Linux job while ensuring the correct runner is used.
65-68
: Upgrade build job to v2 and standardize cache-key input
The build job now referencesjobs-dotnet-build@v2
and correctly switches to kebab-case for therestore-cache-key
input, matching the output naming from your restore step.
80-84
: Upgrade pack job to v2, drop obsolete input, and rename cache-key
The pack job has been updated tojobs-dotnet-pack@v2
, the unusedupload-packed-artifact
input removed, and the cache key input normalized torestore-cache-key
.
95-100
: Upgrade test job to v2 and align cache-key expression
The test job now invokesjobs-dotnet-test@v2
. The expression forrestore-cache-key
has been adjusted to reference the kebab-case output from the appropriate prepare job based on OS.
187-187
: Add integration_test as a deployment dependency
The deploy job now correctly waits forintegration_test
, ensuring that end-to-end tests pass before publishing packages.
- name: Restore Cache | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: | | ||
${{ github.workspace }} | ||
!${{ github.workspace }}/.git | ||
~/.nuget/packages | ||
key: ${{ needs.prepare_linux.outputs.restoreCacheKey }} | ||
restore-keys: | | ||
dotnet-restore- | ||
enableCrossOsArchive: true | ||
fail-on-cache-miss: true |
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 cache restore step in integration_test
There are two issues here that will block cache restoration:
- The official action is
actions/cache@v4
, notactions/cache/restore@v4
. - The output name should use kebab-case (
restore-cache-key
), not CamelCase (restoreCacheKey
).
Apply this diff:
- - name: Restore Cache
- uses: actions/cache/restore@v4
+ - name: Restore Cache
+ uses: actions/cache@v4
with:
path: |
${{ github.workspace }}
!${{ github.workspace }}/.git
~/.nuget/packages
- key: ${{ needs.prepare_linux.outputs.restoreCacheKey }}
+ key: ${{ needs.prepare_linux.outputs.restore-cache-key }}
restore-keys: |
dotnet-restore-
enableCrossOsArchive: true
fail-on-cache-miss: true
📝 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.
- name: Restore Cache | |
uses: actions/cache/restore@v4 | |
with: | |
path: | | |
${{ github.workspace }} | |
!${{ github.workspace }}/.git | |
~/.nuget/packages | |
key: ${{ needs.prepare_linux.outputs.restoreCacheKey }} | |
restore-keys: | | |
dotnet-restore- | |
enableCrossOsArchive: true | |
fail-on-cache-miss: true | |
- name: Restore Cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
${{ github.workspace }} | |
!${{ github.workspace }}/.git | |
~/.nuget/packages | |
key: ${{ needs.prepare_linux.outputs.restore-cache-key }} | |
restore-keys: | | |
dotnet-restore- | |
enableCrossOsArchive: true | |
fail-on-cache-miss: true |
🤖 Prompt for AI Agents
In .github/workflows/pipelines.yml around lines 131 to 142, the cache restore
step uses an incorrect action name and output variable casing. Change the action
from 'actions/cache/restore@v4' to the correct 'actions/cache@v4'. Also, update
the output variable from 'restoreCacheKey' to 'restore-cache-key' to match
kebab-case naming conventions. These changes will fix the cache restoration
process.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #121 +/- ##
==========================================
- Coverage 80.17% 79.82% -0.35%
==========================================
Files 596 593 -3
Lines 18513 18283 -230
Branches 1902 1865 -37
==========================================
- Hits 14843 14595 -248
- Misses 3599 3618 +19
+ Partials 71 70 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
This pull request refactors the
.github/workflows/pipelines.yml
file to streamline job definitions, improve consistency, and fix minor issues. The most significant changes include replacing custom job steps with reusable workflows, correcting a syntax issue in matrix configuration, and updating job dependencies for deployment.Refactoring and Reusability:
prepare_linux
andprepare_windows
job definitions with reusable workflows (codebeltnet/jobs-dotnet-restore/.github/workflows/default.yml@v1
). This change simplifies the workflow by consolidating shared logic.Syntax Fixes:
restore-cache-key
reference to use the correct format (restore-cache-key
instead ofrestoreCacheKey
).Deployment Updates:
deploy
job'sneeds
property to includeintegration_test
, ensuring all necessary dependencies are accounted for before deployment.Summary by CodeRabbit