Skip to content

test: MSTest / xUnit #30

test: MSTest / xUnit

test: MSTest / xUnit #30

Workflow file for this run

# 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: net6.0
sdk: 6.0.x
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.framework }} -p:Platform=${{ matrix.arch }} --no-restore
dotnet build SharpSevenZip.Tests.MSTest/SharpSevenZip.Tests.MSTest.csproj -c Release -f net472 -p:Platform=${{ matrix.arch }} --no-restore
dotnet build SharpSevenZip.Tests.xUnit/SharpSevenZip.Tests.xUnit.csproj -c Release -f net472 -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
dotnet build SharpSevenZip.Tests.MSTest/SharpSevenZip.Tests.MSTest.csproj -c Release -f net472 -p:Platform=${{ matrix.arch }} --no-restore
dotnet build SharpSevenZip.Tests.xUnit/SharpSevenZip.Tests.xUnit.csproj -c Release -f net472 -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.framework }} -p:Platform=${{ matrix.arch }} --no-build --verbosity normal
dotnet test SharpSevenZip.Tests.MSTest/SharpSevenZip.Tests.MSTest.csproj -c Release -f ${{ matrix.framework }} -p:Platform=${{ matrix.arch }} --no-build --verbosity normal
dotnet test SharpSevenZip.Tests.xUnit/SharpSevenZip.Tests.xUnit.csproj -c Release -f ${{ matrix.framework }} -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
dotnet test SharpSevenZip.Tests.MSTest/SharpSevenZip.Tests.MSTest.csproj -c Release -f net472 -p:Platform=${{ matrix.arch }} --no-build --verbosity normal
dotnet test SharpSevenZip.Tests.xUnit/SharpSevenZip.Tests.xUnit.csproj -c Release -f net472 -p:Platform=${{ matrix.arch }} --no-build --verbosity normal