Add real functional unit tests that validate actual behavior #14
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: CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - develop | |
| paths-ignore: | |
| - 'README.md' | |
| - 'docs/**' | |
| pull_request: | |
| branches: | |
| - master | |
| - develop | |
| env: | |
| DOTNET_VERSION: '10.0' | |
| NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages | |
| jobs: | |
| build-and-test: | |
| name: Build and Test | |
| runs-on: windows-latest | |
| env: | |
| BUILD_CONFIGURATION: Release | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: ${{ env.DOTNET_VERSION }} | |
| - name: Cache NuGet packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.NUGET_PACKAGES }} | |
| key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} | |
| restore-keys: | | |
| ${{ runner.os }}-nuget- | |
| - name: Restore packages | |
| run: dotnet restore CyberdyneDevelopment.RoslynTools.sln | |
| - name: Build | |
| run: | | |
| dotnet build-server shutdown | |
| dotnet build CyberdyneDevelopment.RoslynTools.sln --configuration ${{ env.BUILD_CONFIGURATION }} --no-restore -p:UseSharedCompilation=false -p:ContinuousIntegrationBuild=true | |
| - name: Run tests | |
| run: dotnet test CyberdyneDevelopment.RoslynTools.sln --configuration ${{ env.BUILD_CONFIGURATION }} --no-build --verbosity normal | |
| continue-on-error: ${{ github.ref == 'refs/heads/develop' }} | |
| - name: Pack CLI tool | |
| if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' | |
| run: dotnet pack src/CyberdyneDevelopment.RoslynTools.CLI/CyberdyneDevelopment.RoslynTools.CLI.csproj --configuration ${{ env.BUILD_CONFIGURATION }} --no-build --output ${{ github.workspace }}/packages | |
| - name: Upload packages | |
| if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: packages | |
| path: ${{ github.workspace }}/packages |