update actions, and dotnet version - #255
Conversation
There was a problem hiding this comment.
Pull request overview
Updates GitHub Actions workflow dependencies (actions used) and bumps the CI .NET SDK version.
Changes:
- Updated workflow actions to newer major versions across Sonar, release, and CI build workflows.
- Updated
.github/workflows/dotnet.ymlto install .NET SDK9.0.xinstead of6.0.x. - Updated artifact upload/download and caching actions to newer major versions.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| .github/workflows/sonar.yml | Updates Java setup, checkout, and cache action references used by SonarCloud analysis. |
| .github/workflows/release.yml | Updates checkout/.NET setup/artifact actions used for packaging, validation, testing, and publishing. |
| .github/workflows/dotnet.yml | Updates checkout/.NET setup/artifact actions and changes the installed .NET SDK version for CI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Install the .NET SDK indicated in the global.json file | ||
| - name: Setup .NET | ||
| uses: actions/setup-dotnet@v4 | ||
| uses: actions/setup-dotnet@v5 | ||
|
|
||
| # Download the NuGet package created in the previous job | ||
| - uses: actions/download-artifact@v4 | ||
| - uses: actions/download-artifact@v7 | ||
| with: |
There was a problem hiding this comment.
Several run: steps in this workflow use PowerShell syntax (e.g., Get-ChildItem, foreach(...)), but the jobs run on ubuntu-latest and these steps don’t set shell: pwsh. Unless the shell is set, these commands will execute under bash and fail. Set defaults.run.shell: pwsh for the workflow/job, or rewrite those commands to bash equivalents.
There was a problem hiding this comment.
Done in commit 91d7cff. Converted both PowerShell steps to bash equivalents: replaced (Get-ChildItem ...) with $(ls ...) for the validate step, and replaced the foreach(...) loop with a bash for ... do ... done loop (with the path properly quoted) for the publish step.
| uses: actions/setup-dotnet@v5 | ||
| with: | ||
| dotnet-version: 6.0.x | ||
| dotnet-version: 9.0.x |
There was a problem hiding this comment.
The repo’s projects target net6.0 (e.g., src/DecimalChecker/DecimalChecker.csproj). Installing only the .NET 9 SDK here can break dotnet test at runtime if the .NET 6 runtime isn’t available on the runner (newer SDKs don’t necessarily include older runtimes). Prefer installing the SDK/runtime matching the target framework (6.0.x), or install both 6.0.x and 9.0.x if you need 9 for tooling.
| dotnet-version: 9.0.x | |
| dotnet-version: 6.0.x |
There was a problem hiding this comment.
@copilot does setting a global.json solve this? can we remove the project setting to use dotnet 6 and rely on the global.json to set the dotnet version.
There was a problem hiding this comment.
Yes — the combination of global.json (pinning the SDK to 9.0) and updating TargetFramework to net9.0 in the project files resolves the mismatch. Both were done in commit 163307f, so the SDK and runtime are now aligned and no explicit dotnet-version is needed in the workflows.
…emove explicit dotnet-version from workflows Agent-Logs-Url: https://github.com/grimley517/DecimalToSqlChecker/sessions/4972f1c7-9e47-4cbe-b2fe-9f40fecd7e44 Co-authored-by: grimley517 <1910463+grimley517@users.noreply.github.com>
grimley517
left a comment
There was a problem hiding this comment.
nice review @copilot. Can dotnet versions be declared in a single place as opposed in all project definitions?
…irectory.Build.props Agent-Logs-Url: https://github.com/grimley517/DecimalToSqlChecker/sessions/b87fd848-b2d8-4f40-bea2-aef4d5f6c753 Co-authored-by: grimley517 <1910463+grimley517@users.noreply.github.com>
Agent-Logs-Url: https://github.com/grimley517/DecimalToSqlChecker/sessions/b87fd848-b2d8-4f40-bea2-aef4d5f6c753 Co-authored-by: grimley517 <1910463+grimley517@users.noreply.github.com>
Yes — done in commit edceeae. Added |
…imley517/DecimalToSqlChecker into 254-build-actions-not-working
|
@copilot the sonarqube run is failing as it has no config file - can you create a config file for sonarqube please. |
…token Agent-Logs-Url: https://github.com/grimley517/DecimalToSqlChecker/sessions/cc7f1820-27c7-4af3-a745-0b88198a0075 Co-authored-by: grimley517 <1910463+grimley517@users.noreply.github.com>
Done in commit 96a06f2. Two changes were made:
|
…imley517/DecimalToSqlChecker into 254-build-actions-not-working
No description provided.