Skip to content

Commit 884d91d

Browse files
committed
Build code upfront
1 parent 41b1e1e commit 884d91d

File tree

2 files changed

+15
-18
lines changed

2 files changed

+15
-18
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
name: Build
1010

1111
on:
12+
workflow_dispatch:
1213
push:
1314
branches: [ 'master', 'release/**' ]
1415
pull_request:
@@ -57,11 +58,9 @@ jobs:
5758
- name: Git checkout
5859
uses: actions/checkout@v4
5960
- name: Restore tools
60-
run: |
61-
dotnet tool restore
61+
run: dotnet tool restore
6262
- name: Restore packages
63-
run: |
64-
dotnet restore
63+
run: dotnet restore
6564
- name: Calculate version suffix
6665
shell: pwsh
6766
run: |
@@ -94,8 +93,7 @@ jobs:
9493
Write-Output "PACKAGE_VERSION_SUFFIX=$versionSuffix" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
9594
- name: Build
9695
shell: pwsh
97-
run: |
98-
dotnet build --no-restore --configuration Release /p:VersionSuffix=$env:PACKAGE_VERSION_SUFFIX
96+
run: dotnet build --no-restore --configuration Release /p:VersionSuffix=$env:PACKAGE_VERSION_SUFFIX
9997
- name: Test
10098
env:
10199
# Override log levels, to reduce logging output when running tests in ci-build.
@@ -104,8 +102,7 @@ jobs:
104102
Logging__LogLevel__Microsoft.Extensions.Hosting.Internal.Host: 'None'
105103
Logging__LogLevel__Microsoft.EntityFrameworkCore.Database.Command: 'None'
106104
Logging__LogLevel__JsonApiDotNetCore: 'None'
107-
run: |
108-
dotnet test --no-build --configuration Release --collect:"XPlat Code Coverage" --logger "GitHubActions;summary.includeSkippedTests=true"
105+
run: dotnet test --no-build --configuration Release --collect:"XPlat Code Coverage" --logger "GitHubActions;summary.includeSkippedTests=true"
109106
- name: Upload coverage to codecov.io
110107
if: matrix.os == 'ubuntu-latest'
111108
env:
@@ -116,8 +113,7 @@ jobs:
116113
verbose: true
117114
- name: Generate packages
118115
shell: pwsh
119-
run: |
120-
dotnet pack --no-build --configuration Release --output $env:GITHUB_WORKSPACE/artifacts/packages /p:VersionSuffix=$env:PACKAGE_VERSION_SUFFIX
116+
run: dotnet pack --no-build --configuration Release --output $env:GITHUB_WORKSPACE/artifacts/packages /p:VersionSuffix=$env:PACKAGE_VERSION_SUFFIX
121117
- name: Upload packages to artifacts
122118
if: matrix.os == 'ubuntu-latest'
123119
uses: actions/upload-artifact@v4
@@ -169,8 +165,7 @@ jobs:
169165
- name: Git checkout
170166
uses: actions/checkout@v4
171167
- name: Restore tools
172-
run: |
173-
dotnet tool restore
168+
run: dotnet tool restore
174169
- name: InspectCode
175170
shell: pwsh
176171
run: |
@@ -226,11 +221,9 @@ jobs:
226221
with:
227222
fetch-depth: 2
228223
- name: Restore tools
229-
run: |
230-
dotnet tool restore
224+
run: dotnet tool restore
231225
- name: Restore packages
232-
run: |
233-
dotnet restore
226+
run: dotnet restore
234227
- name: CleanupCode (on PR diff)
235228
if: github.event_name == 'pull_request'
236229
shell: pwsh

.github/workflows/qodana.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# https://www.jetbrains.com/help/qodana/cloud-forward-reports.html#cloud-forward-reports-github-actions
2-
31
name: Qodana
42
on:
53
workflow_dispatch:
@@ -21,6 +19,12 @@ jobs:
2119
with:
2220
ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit
2321
fetch-depth: 0 # a full history is required for pull request analysis
22+
- name: Restore tools
23+
run: dotnet tool restore
24+
- name: Restore packages
25+
run: dotnet restore
26+
- name: Build
27+
run: dotnet build --no-restore
2428
- name: 'Qodana Scan'
2529
uses: JetBrains/qodana-action@v2025.1
2630
with:

0 commit comments

Comments
 (0)