diff --git a/.github/actions/install-and-setup/action.yml b/.github/actions/install-and-setup/action.yml index cf27921bc..ded457677 100644 --- a/.github/actions/install-and-setup/action.yml +++ b/.github/actions/install-and-setup/action.yml @@ -50,14 +50,23 @@ runs: with: nuget-version: 6.11.0 - name: Install dotnet - uses: actions/setup-dotnet@v4 + uses: actions/setup-dotnet@v5 # Try v5 for better MSBuild handling with: dotnet-version: '6.x' + - - name: Install Mono on MacOS - run: brew install mono + - name: Install Mono on MacOS with MSBuild environment setup if: runner.os == 'macOS' - shell: 'bash' + run: | + echo "Installing modern Mono with .NET MSBuild integration" + brew install mono + + # Set MSBuild environment variables to use .NET SDK MSBuild instead of Mono's + echo "MSBUILD_EXE_PATH=$HOME/.dotnet/sdk/6.0.428/MSBuild.dll" >> $GITHUB_ENV + echo "MSBuildSDKsPath=$HOME/.dotnet/sdk/6.0.428/Sdks" >> $GITHUB_ENV + + echo "Configured to use .NET MSBuild with Mono runtime" + shell: bash - name: Install Mono on Linux run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d841e6d56..ef2222a94 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -58,6 +58,27 @@ jobs: - name: Run Go vet run: go vet -v ./... + NuGet_Unit_Tests_Fast: + name: "[${{ matrix.os }}] NuGet Unit Tests (Fast Check)" + needs: Pretest + runs-on: ${{ matrix.os }}-latest + strategy: + fail-fast: false + matrix: + os: [ macos ] # Only test macOS where the issue occurs + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - name: Install and Setup Dependencies + uses: ./.github/actions/install-and-setup + + # Test only NuGet unit tests for fast feedback + - name: Run NuGet tests only + run: go test ./sca/bom/buildinfo/technologies/nuget -v -timeout 5m + Unit_Tests: name: "[${{ matrix.os }}] Unit Tests" needs: Pretest @@ -98,6 +119,8 @@ jobs: matrix: os: [ ubuntu, windows, macos ] suite: + - name: 'C/C++/C# Suite (Conan, NuGet, Dotnet)' + testFlags: '--test.audit.C' - name: 'General Suite (Detection, MultiTech, NoTech...)' testFlags: '--test.audit' - name: 'JAS Suite' @@ -110,8 +133,6 @@ jobs: testFlags: '--test.audit.Java' - name: 'Go Suite (Go Modules, Dep, Glide)' testFlags: '--test.audit.Go' - - name: 'C/C++/C# Suite (Conan, NuGet, Dotnet)' - testFlags: '--test.audit.C' - name: 'Cocoapods Suite' testFlags: '--test.audit.Cocoapods' - name: 'Swift Suite'