test: MSTest / xUnit #34
Workflow file for this run
This file contains hidden or 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
| # This workflow will build a .NET project | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | |
| name: .NET | |
| on: | |
| push: | |
| branches: [ "dev" ] | |
| pull_request: | |
| branches: [ "dev" ] | |
| jobs: | |
| build: | |
| defaults: | |
| run: | |
| working-directory: SharpSevenZip | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ windows-latest ] | |
| arch: [ x64, x86 ] | |
| framework: | |
| - netstandard2.0 | |
| - net6.0 | |
| - net8.0 | |
| - net48 | |
| include: | |
| - sdk: 8.0.x | |
| - framework: net8.0 | |
| runtime: net8.0 | |
| - framework: net6.0 | |
| runtime: net6.0 | |
| sdk: 6.0.x | |
| - framework: net48 | |
| runtime: net48 | |
| - framework: netstandard2.0 | |
| runtime: net472 | |
| - framework: netstandard2.0 | |
| runtime: net462 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Enable SFN | |
| run: fsutil behavior set disable8dot3 0 | |
| working-directory: . | |
| - uses: actions/checkout@v4 | |
| # This must be done before the normal setup-dotnet action to ensure DOTNET_ROOT refers to the 64-bit installation | |
| - name: Setup .NET x86 | |
| if: ${{ matrix.arch == 'x86' }} | |
| uses: actions/setup-dotnet@v4 | |
| env: | |
| PROCESSOR_ARCHITECTURE: x86 | |
| DOTNET_INSTALL_DIR: C:\Program Files (x86)\dotnet | |
| with: | |
| dotnet-version: ${{ matrix.sdk }} | |
| # Copy DOTNET_ROOT from the above step to DOTNET_ROOT(x86), the next step will overwrite DOTNET_ROOT to refer to the 64-bit installation | |
| - name: Set DOTNET_ROOT(x86) | |
| if: ${{ matrix.arch == 'x86' }} | |
| shell: pwsh | |
| run: | | |
| echo "DOTNET_ROOT(x86)=${env:DOTNET_ROOT}" | Out-File -FilePath $env:GITHUB_ENV -Append | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: ${{ matrix.sdk }} | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build | |
| run: dotnet build SharpSevenZip/SharpSevenZip.csproj -c Release -f ${{ matrix.framework }} -p:Platform=${{ matrix.arch }} --no-restore | |
| - name: Build (Test) | |
| if: ${{ matrix.framework != 'netstandard2.0' }} | |
| run: | | |
| dotnet build SharpSevenZip.Tests/SharpSevenZip.Tests.csproj -c Release -f ${{ matrix.runtime }} -p:Platform=${{ matrix.arch }} --no-restore | |
| - name: Build (Test) | |
| if: ${{ matrix.framework == 'netstandard2.0' }} | |
| run: | | |
| dotnet build SharpSevenZip.NetStd20.Tests/SharpSevenZip.NetStd20.Tests.csproj -c Release -p:Platform=${{ matrix.arch }} --no-restore | |
| - name: Build (Test) | |
| run: | | |
| dotnet build SharpSevenZip.Tests.MSTest/SharpSevenZip.Tests.MSTest.csproj -c Release -f ${{ matrix.runtime }} -p:Platform=${{ matrix.arch }} --no-restore | |
| dotnet build SharpSevenZip.Tests.xUnit/SharpSevenZip.Tests.xUnit.csproj -c Release -f ${{ matrix.runtime }} -p:Platform=${{ matrix.arch }} --no-restore | |
| - name: Build (Benchmarks) | |
| if: ${{ matrix.framework != 'netstandard2.0' && !(matrix.framework == 'net48' && matrix.arch == 'x64') }} | |
| run: dotnet build SharpSevenZipBenchmarks/SharpSevenZipBenchmarks.csproj -c Release -f ${{ matrix.framework }} -p:Platform=${{ matrix.arch }} --no-restore | |
| - name: Test | |
| if: ${{ matrix.framework != 'netstandard2.0' }} | |
| run: | | |
| dotnet test SharpSevenZip.Tests/SharpSevenZip.Tests.csproj -c Release -f ${{ matrix.runtime }} -p:Platform=${{ matrix.arch }} --no-build --verbosity normal | |
| - name: Test | |
| if: ${{ matrix.framework == 'netstandard2.0' }} | |
| run: | | |
| dotnet test SharpSevenZip.NetStd20.Tests/SharpSevenZip.NetStd20.Tests.csproj -c Release -p:Platform=${{ matrix.arch }} --no-build --verbosity normal | |
| - name: Test (MSTest) | |
| run: | | |
| dotnet test SharpSevenZip.Tests.MSTest/SharpSevenZip.Tests.MSTest.csproj -c Release -f ${{ matrix.runtime }} -p:Platform=${{ matrix.arch }} --no-build --verbosity normal | |
| - name: Test (xUnit) | |
| run: | | |
| dotnet test SharpSevenZip.Tests.xUnit/SharpSevenZip.Tests.xUnit.csproj -c Release -f ${{ matrix.runtime }} -p:Platform=${{ matrix.arch }} --no-build --verbosity normal | |