Skip to content

Commit a32d0eb

Browse files
Rework workflow
1 parent b591897 commit a32d0eb

File tree

1 file changed

+53
-7
lines changed

1 file changed

+53
-7
lines changed

.github/workflows/pre_release.yml

Lines changed: 53 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,35 +9,79 @@ jobs:
99

1010
steps:
1111
- uses: actions/checkout@v2
12+
1213
- name: Setup dotnet
1314
uses: actions/setup-dotnet@v4
1415
with:
1516
dotnet-version: |
1617
6.x
1718
8.x
19+
1820
- name: Get the version
1921
id: get_version
2022
uses: mavrosxristoforos/get-xml-info@1.0
2123
with:
2224
xml-file: './Directory.Build.props'
2325
xpath: '//Version'
26+
2427
- name: Create short version
2528
id: shortversion
2629
run: |
2730
$version = "${{ steps.get_version.outputs.info }}".Substring(0, "${{ steps.get_version.outputs.info }}".LastIndexOf("."))
2831
Write-Host "::set-output name=shortversion::$version-alpha"
2932
shell: pwsh
30-
- uses: actions/checkout@v2
33+
3134
- name: Restore dependencies
3235
run: dotnet restore
36+
3337
- name: Build
34-
run: dotnet build --no-restore -c Release -p:VersionSuffix=alpha ./SerilogSinksInMemory.sln
38+
run: dotnet build -c Release -p:VersionSuffix=alpha ./SerilogSinksInMemory.sln
39+
3540
- name: Test
36-
run: dotnet test --no-build --verbosity normal -c Release
41+
run: dotnet test --verbosity normal -c Release
42+
3743
- name: Create NuGet package for Serilog.Sinks.InMemory
38-
run: dotnet pack ./src/Serilog.Sinks.InMemory/Serilog.Sinks.InMemory.csproj -c Release --no-build --no-restore -o ./packaging -p:VersionSuffix=-alpha
44+
run: dotnet pack ./src/Serilog.Sinks.InMemory/Serilog.Sinks.InMemory.csproj -c Release -o ./packages -p:VersionSuffix=-alpha
45+
3946
- name: Create NuGet package for Serilog.Sinks.InMemory.Assertions
40-
run: dotnet pack ./src/Serilog.Sinks.InMemory.Assertions/Serilog.Sinks.InMemory.Assertions.csproj -c Release --no-build --no-restore -o ./packaging -p:VersionSuffix=-alpha
47+
run: dotnet pack ./src/Serilog.Sinks.InMemory.Assertions/Serilog.Sinks.InMemory.Assertions.csproj -c Release -o ./packages -p:VersionSuffix=-alpha
48+
49+
- name: Run integration tests for FluentAssertions 5
50+
working-directory: test/Serilog.Sinks.InMemory.Assertions.Tests.Integration.FluentAssertions5
51+
run: |
52+
dotnet restore -p:Version=${{ steps.shortversion.outputs.shortversion }}
53+
dotnet test --no-restore -c Release Serilog.Sinks.InMemory.Assertions.Tests.Integration.FluentAssertions5.csproj
54+
55+
- name: Run integration tests for FluentAssertions 6
56+
working-directory: test/Serilog.Sinks.InMemory.Assertions.Tests.Integration.FluentAssertions6
57+
run: |
58+
dotnet restore -p:Version=${{ steps.shortversion.outputs.shortversion }}
59+
dotnet test --no-restore -c Release Serilog.Sinks.InMemory.Assertions.Tests.Integration.FluentAssertions6.csproj
60+
61+
- name: Run integration tests for FluentAssertions 7
62+
working-directory: test/Serilog.Sinks.InMemory.Assertions.Tests.Integration.FluentAssertions7
63+
run: |
64+
dotnet restore -p:Version=${{ steps.shortversion.outputs.shortversion }}
65+
dotnet test --no-restore -c Release Serilog.Sinks.InMemory.Assertions.Tests.Integration.FluentAssertions7.csproj
66+
67+
- name: Run integration tests for FluentAssertions 8
68+
working-directory: test/Serilog.Sinks.InMemory.Assertions.Tests.Integration.FluentAssertions8
69+
run: |
70+
dotnet restore -p:Version=${{ steps.shortversion.outputs.shortversion }}
71+
dotnet test --no-restore -c Release Serilog.Sinks.InMemory.Assertions.Tests.Integration.FluentAssertions8.csproj
72+
73+
- name: Run integration tests for AwesomeAssertions 8
74+
working-directory: test/Serilog.Sinks.InMemory.Assertions.Tests.Integration.AwesomeAssertions8
75+
run: |
76+
dotnet restore -p:Version=${{ steps.shortversion.outputs.shortversion }}
77+
dotnet test --no-restore -c Release Serilog.Sinks.InMemory.Assertions.Tests.Integration.AwesomeAssertions8.csproj
78+
79+
- name: Run integration tests for Shouldly 4.x
80+
working-directory: test/Serilog.Sinks.InMemory.Assertions.Tests.Integration.Shouldly4
81+
run: |
82+
dotnet restore -p:Version=${{ steps.shortversion.outputs.shortversion }}
83+
dotnet test --no-restore -c Release Serilog.Sinks.InMemory.Assertions.Tests.Integration.Shouldly4.csproj
84+
4185
- name: Create Release
4286
id: create_release
4387
uses: actions/create-release@v1
@@ -48,23 +92,25 @@ jobs:
4892
release_name: ${{ steps.get_version.outputs.info }}-alpha
4993
draft: false
5094
prerelease: true
95+
5196
- name: Upload sink NuGet package
5297
id: upload-nuget-sink
5398
uses: actions/upload-release-asset@v1
5499
env:
55100
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56101
with:
57102
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
58-
asset_path: ./packaging/Serilog.Sinks.InMemory.${{ steps.shortversion.outputs.shortversion }}.nupkg
103+
asset_path: ./packages/Serilog.Sinks.InMemory.${{ steps.shortversion.outputs.shortversion }}.nupkg
59104
asset_name: Serilog.Sinks.InMemory.${{ steps.shortversion.outputs.shortversion }}.nupkg
60105
asset_content_type: application/octet-stream
106+
61107
- name: Upload assertions NuGet package
62108
id: upload-nuget-assertions
63109
uses: actions/upload-release-asset@v1
64110
env:
65111
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66112
with:
67113
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
68-
asset_path: ./packaging/Serilog.Sinks.InMemory.Assertions.${{ steps.shortversion.outputs.shortversion }}.nupkg
114+
asset_path: ./packages/Serilog.Sinks.InMemory.Assertions.${{ steps.shortversion.outputs.shortversion }}.nupkg
69115
asset_name: Serilog.Sinks.InMemory.Assertions.${{ steps.shortversion.outputs.shortversion }}.nupkg
70116
asset_content_type: application/octet-stream

0 commit comments

Comments
 (0)