Skip to content

GitVersion rework

GitVersion rework #21

Workflow file for this run

name: Messaging PR Build

Check failure on line 1 in .github/workflows/pr.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/pr.yml

Invalid workflow file

You have an error in your yaml syntax
permissions:
contents: read
packages: read
on:
pull_request:
branches: [ main, develop ]
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
calculate-version:
name: "Calculate Version"
runs-on: ubuntu-latest
outputs:
version: ${{ steps.gitversion.outputs.SemVer }}
nuget-version: ${{ steps.gitversion.outputs.NuGetVersion }}
assembly-version: ${{ steps.gitversion.outputs.AssemblySemVer }}
file-version: ${{ steps.gitversion.outputs.AssemblySemFileVer }}
informational-version: ${{ steps.gitversion.outputs.InformationalVersion }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v4.0.1
with:
versionSpec: '6.x'
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/execute@v4.0.1
- name: Display GitVersion outputs
run: |
echo "🔍 PR Version Calculation:"
echo "PR: #${{ github.event.number }} (${{ github.head_ref }} → ${{ github.base_ref }})"
echo "Version: ${{ steps.gitversion.outputs.SemVer }}"
echo "NuGet Version: ${{ steps.gitversion.outputs.NuGetVersion }}"
echo "Assembly Version: ${{ steps.gitversion.outputs.AssemblySemVer }}"
echo "File Version: ${{ steps.gitversion.outputs.AssemblySemFileVer }}"
echo "Informational Version: ${{ steps.gitversion.outputs.InformationalVersion }}}"
run: dotnet test --no-build --verbosity normal -c Release -f ${{ matrix.dotnet-framework }}
summary:
needs: [calculate-version, build]
runs-on: ubuntu-latest
if: always()
steps:
- name: PR Build Summary
run: |
echo "## 🔍 Pull Request Build Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Property | Value |" >> $GITHUB_STEP_SUMMARY
echo "|----------|-------|" >> $GITHUB_STEP_SUMMARY
echo "| PR Number | #${{ github.event.number }} |" >> $GITHUB_STEP_SUMMARY
echo "| Source Branch | \`${{ github.head_ref }}\` |" >> $GITHUB_STEP_SUMMARY
echo "| Target Branch | \`${{ github.base_ref }}\` |" >> $GITHUB_STEP_SUMMARY
echo "| Version | \`${{ needs.calculate-version.outputs.version }}\` |" >> $GITHUB_STEP_SUMMARY
echo "| NuGet Version | \`${{ needs.calculate-version.outputs.nuget-version }}\` |" >> $GITHUB_STEP_SUMMARY
echo "| Build Status | ${{ needs.build.result == 'success' && '✅ Success' || '❌ Failed' }} |" >> $GITHUB_STEP_SUMMARY
echo "| Coverage | ${{ needs.build.result == 'success' && '📊 Collected' || '❌ Not Available' }} |" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ "${{ needs.build.result }}" == "success" ]; then
echo "✅ **Build Successful**: All tests passed and code coverage was collected." >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "📋 **Test Execution Notes**:" >> $GITHUB_STEP_SUMMARY
echo "- **Ubuntu**: All tests executed" >> $GITHUB_STEP_SUMMARY
echo "- **Windows**: All tests executed" >> $GITHUB_STEP_SUMMARY
else
echo "❌ **Build Failed**: Please check the build logs for more details." >> $GITHUB_STEP_SUMMARY
fi
echo "" >> $GITHUB_STEP_SUMMARY
echo "📝 **Note**: This is a PR build - no packages are published." >> $GITHUB_STEP_SUMMARY