設定既定値をConfigSettingsへ集約しconfig.jsonをoverride専用化 #77
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 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| global-json-file: global.json | |
| - name: Cache NuGet packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.nuget/packages | |
| key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} | |
| restore-keys: | | |
| ${{ runner.os }}-nuget- | |
| - name: Restore dependencies | |
| run: dotnet restore FolderDiffIL4DotNet.sln | |
| - name: Build | |
| run: dotnet build FolderDiffIL4DotNet.sln --configuration Release --no-restore | |
| - name: Install DocFX | |
| run: dotnet tool update --global docfx --version '2.*' | |
| - name: Generate documentation site | |
| run: | | |
| export PATH="$PATH:$HOME/.dotnet/tools" | |
| docfx metadata docfx.json | |
| docfx build docfx.json | |
| - name: Test with coverage | |
| if: ${{ hashFiles('FolderDiffIL4DotNet.Tests/FolderDiffIL4DotNet.Tests.csproj') != '' }} | |
| run: dotnet test FolderDiffIL4DotNet.Tests/FolderDiffIL4DotNet.Tests.csproj --configuration Release --no-build --nologo --logger "trx;LogFileName=test_results.trx" --collect:"XPlat Code Coverage" --results-directory ./TestResults | |
| - name: Install ReportGenerator | |
| if: ${{ hashFiles('FolderDiffIL4DotNet.Tests/FolderDiffIL4DotNet.Tests.csproj') != '' }} | |
| run: dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.* | |
| - name: Generate coverage report | |
| if: ${{ hashFiles('FolderDiffIL4DotNet.Tests/FolderDiffIL4DotNet.Tests.csproj') != '' }} | |
| run: | | |
| export PATH="$PATH:$HOME/.dotnet/tools" | |
| reportgenerator \ | |
| -reports:"TestResults/**/coverage.cobertura.xml" \ | |
| -targetdir:"CoverageReport" \ | |
| -reporttypes:"MarkdownSummaryGithub;Cobertura;HtmlInline_AzurePipelines" | |
| if [ -f "CoverageReport/SummaryGithub.md" ]; then | |
| cat CoverageReport/SummaryGithub.md >> "$GITHUB_STEP_SUMMARY" | |
| fi | |
| - name: Upload test and coverage artifacts | |
| if: ${{ always() && hashFiles('FolderDiffIL4DotNet.Tests/FolderDiffIL4DotNet.Tests.csproj') != '' }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: TestAndCoverage | |
| if-no-files-found: warn | |
| path: | | |
| TestResults/**/*.trx | |
| TestResults/**/coverage.cobertura.xml | |
| CoverageReport/** | |
| - name: Upload documentation artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: DocumentationSite | |
| path: _site/** | |
| - name: Publish | |
| run: dotnet publish FolderDiffIL4DotNet.csproj --configuration Release --no-build --output publish | |
| - name: Remove debugging symbols | |
| run: find publish -name '*.pdb' -delete | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: FolderDiffIL4DotNet | |
| path: publish/** |