Run integration tests for all FluentAssertions versions against the n… #31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build-and-test | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: | | |
6.x | |
8.x | |
- name: Unit tests | |
run: dotnet test -c Release | |
- name: Create local packages | |
run: | | |
dotnet pack -c Release -o packages src/Serilog.Sinks.InMemory/Serilog.Sinks.InMemory.csproj | |
dotnet pack -c Release -o packages src/Serilog.Sinks.InMemory.Assertions/Serilog.Sinks.InMemory.Assertions.csproj | |
- name: Get the version | |
id: get_version | |
uses: mavrosxristoforos/[email protected] | |
with: | |
xml-file: './Directory.Build.props' | |
xpath: '//Version' | |
- name: Create short version | |
id: shortversion | |
run: | | |
$version = "${{ steps.get_version.outputs.info }}".Substring(0, "${{ steps.get_version.outputs.info }}".LastIndexOf(".")) | |
Write-Host "::set-output name=shortversion::$version" | |
shell: pwsh | |
- name: Run integration tests for FluentAssertions 5 | |
working-directory: test/Serilog.Sinks.InMemory.Assertions.Tests.Integration.FluentAssertions5 | |
run: | | |
dotnet restore -p:Version=${{ steps.shortversion.outputs.shortversion }} | |
dotnet test --no-restore -c Release Serilog.Sinks.InMemory.Assertions.Tests.Integration.FluentAssertions5.csproj | |
- name: Run integration tests for FluentAssertions 6 | |
working-directory: test/Serilog.Sinks.InMemory.Assertions.Tests.Integration.FluentAssertions6 | |
run: | | |
dotnet restore -p:Version=${{ steps.shortversion.outputs.shortversion }} | |
dotnet test --no-restore -c Release Serilog.Sinks.InMemory.Assertions.Tests.Integration.FluentAssertions6.csproj | |
- name: Run integration tests for FluentAssertions 8 | |
working-directory: test/Serilog.Sinks.InMemory.Assertions.Tests.Integration.FluentAssertions8 | |
run: | | |
dotnet restore -p:Version=${{ steps.shortversion.outputs.shortversion }} | |
dotnet test --no-restore -c Release Serilog.Sinks.InMemory.Assertions.Tests.Integration.FluentAssertions8.csproj |