Skip to content

Commit ed7a1cb

Browse files
committed
fold workflow into single job
1 parent c2a324b commit ed7a1cb

File tree

1 file changed

+18
-30
lines changed

1 file changed

+18
-30
lines changed

.github/workflows/build-test-installer-release.yml

Lines changed: 18 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ on:
1414
permissions:
1515
contents: write
1616
id-token: write
17+
actions: read
18+
checks: write
1719

1820
env:
1921
Configuration: Release
2022

2123
jobs:
2224
build_test:
23-
name: Build and test
25+
name: Build Test Installer Release
2426
runs-on: windows-latest
2527
outputs:
2628
version: ${{ steps.compute_version.outputs.version }}
@@ -70,10 +72,10 @@ jobs:
7072
with:
7173
vs-version: '[17.0,18.0)'
7274

73-
- name: Build solution
75+
- name: Build
7476
run: msbuild build\SayMore.proj /t:Build /p:Configuration=$env:Configuration /p:Version=$env:Version /m
7577

76-
- name: Run tests
78+
- name: Run Tests
7779
run: msbuild build\SayMore.proj /t:Test /p:Configuration=$env:Configuration /p:useNUnit-x86=true /p:excludedCategories=SkipOnCI /m
7880

7981
- name: Upload test results
@@ -84,40 +86,14 @@ jobs:
8486
if-no-files-found: warn
8587
path: output/${{ env.Configuration }}/TestResults.xml
8688

87-
build_installer:
88-
name: Build installer, sign, and publish artifacts
89-
needs: build_test
90-
if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))) }}
91-
runs-on: windows-latest
92-
env:
93-
Version: ${{ needs.build_test.outputs.version }}
94-
95-
steps:
96-
- name: Checkout
97-
uses: actions/checkout@v5
98-
with:
99-
fetch-depth: 0
100-
submodules: true
101-
102-
- name: Setup NuGet
103-
uses: NuGet/setup-nuget@v2
104-
105-
- name: Restore NuGet packages
106-
run: nuget restore SayMore.sln
107-
10889
- name: Copy CHM file into DistFiles
10990
run: copy "docs\SayMore.chm" "DistFiles\SayMore.chm"
11091

111-
- name: Setup MSBuild
112-
uses: microsoft/setup-msbuild@v2
113-
with:
114-
vs-version: '[17.0,18.0)'
115-
116-
# Build release notes in HTML (this could be replaced with GitHub release notes later)
11792
- name: Create HTML release notes
11893
run: msbuild build\SayMore.proj /t:ConvertReleaseNotesToHtml /p:Version=$env:Version /m
11994

12095
- name: Build installer
96+
if: ${{ github.event_name != 'pull_request' }}
12197
run: msbuild build\SayMore.proj /t:Installer /p:Configuration=$env:Configuration /p:Version=$env:Version /m
12298

12399
- name: Sign installer
@@ -129,6 +105,7 @@ jobs:
129105
files-folder-filter: SayMoreInstaller*.msi
130106

131107
- name: Upload installer artifacts
108+
if: ${{ github.event_name != 'pull_request' }}
132109
uses: actions/upload-artifact@v4
133110
with:
134111
name: saymore-installer
@@ -152,3 +129,14 @@ jobs:
152129
output/ReleaseNotes.htm
153130
draft: true
154131
generate_release_notes: true
132+
report:
133+
name: Test Report
134+
needs: build_test
135+
runs-on: ubuntu-latest
136+
steps:
137+
- uses: dorny/test-reporter@v2
138+
with:
139+
artifact: saymore-test-results
140+
name: NUnit Tests
141+
path: '*.xml'
142+
reporter: dotnet-nunit

0 commit comments

Comments
 (0)