Skip to content

READMEとDEVELOPER_GUIDEの比較フロー説明を役割別に整理 #69

READMEとDEVELOPER_GUIDEの比較フロー説明を役割別に整理

READMEとDEVELOPER_GUIDEの比較フロー説明を役割別に整理 #69

Workflow file for this run

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: 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: 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/**