Updated IGLib.TestBase.csproj #57
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
| name: Build and Test MainRepo1 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: # Allows manual triggering | |
| jobs: | |
| build-and-test: | |
| runs-on: windows-latest # use Windows for .NET Framework support | |
| # runs-on: ubuntu-latest # runs on GitHub-hosted Ubuntu | |
| strategy: | |
| matrix: | |
| dotnet-version: [ '6.0', '8.0' ] | |
| steps: | |
| # CHECKOUT Main Repository | |
| - name: Clone Main Repository | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: ajgorhoe/IGLib.modules.IGLibCore | |
| path: IGLibCore | |
| ref: main | |
| # Temporary token created automatically for the main repo (owner of the workflow) | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| # CLONE IGLibScripts | |
| - name: Clone IGLibScripts | |
| shell: pwsh | |
| run: | | |
| git clone --depth 1 https://github.com/ajgorhoe/IGLib.modules.IGLibScripts ` | |
| IGLibScripts | |
| # CHECKOUT IGLibScripting | |
| - name: Clone IGLibScripting | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: ajgorhoe/IGLib.modules.IGLibScripting | |
| path: IGLibScripting | |
| ref: main | |
| token: ${{ secrets.PAT_ACTIONS_IGLIB_READONLY }} | |
| # CLONE IGLibScripting | |
| - name: Clone IGLibScripting Dependency | |
| shell: pwsh | |
| run: | | |
| git clone --depth 1 https://${{ secrets.PAT_ACTIONS_IGLIB_READONLY }}@github.com/ajgorhoe/IGLib.modules.IGLibScripting ` | |
| IGLibScripting1 | |
| # # SET UP .NET SDK 8.0 | |
| # - name: Setup .NET 8 | |
| # uses: actions/setup-dotnet@v3 | |
| # with: | |
| # dotnet-version: 8.0.x | |
| # # SET UP .NET SDK 6.0 | |
| # - name: Setup .NET 6 | |
| # uses: actions/setup-dotnet@v3 | |
| # with: | |
| # dotnet-version: 6.0.x | |
| - name: SET UP .NET SDK | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: ${{ matrix.dotnet-version }} | |
| - name: Setup MSBuild for .NET Framework | |
| uses: microsoft/setup-msbuild@v1 # Needed for .NET Framework builds | |
| # RUN PRE-BUILD SCRIPT (PowerShell) | |
| - name: Run Pre-Build PowerShell Script | |
| run: pwsh -File IGLibCore/scripts/PrintEnv.ps1 | |
| # RESTORE DEPENDENCIES | |
| - name: Restore NuGet packages | |
| run: dotnet restore IGLibCore/IGLibCore.sln | |
| # BUILD Main Project & Test Project in Release Mode | |
| - name: Build Solution | |
| run: dotnet build IGLibCore/IGLibCore.sln --configuration Release --no-restore | |
| # RUN TESTS & COLLECT RESULTS | |
| - name: Run Unit Tests | |
| run: dotnet test IGLibCore/test/IGLib.Core.Tests/IGLib.Core.Tests.csproj --configuration Release --logger trx --results-directory test-results | |
| # UPLOAD BUILD OUTPUT (DLLs, EXEs, etc.) | |
| - name: Upload Build Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: BuildArtifacts | |
| path: IGLibCore/src/IGLib.Core/bin/Release/ | |
| # RUN a TEST SCRIPT (PowerShell) | |
| - name: Run Post-Build PowerShell Script | |
| run: pwsh -File IGLibCore/scripts/PrintEnv.ps1 |