Skip to content

Add protocol method support for Conversations API #47

Add protocol method support for Conversations API

Add protocol method support for Conversations API #47

# This workflow validates changes made to the codegen folder by running code generation
# and ensuring the process completes successfully without errors.
name: CodeGen Validation
on:
pull_request:
paths:
- 'codegen/**'
- 'specification/**'
- '.github/workflows/codegen-validation.yml'
- 'scripts/Invoke-CodeGen.ps1'
types: [opened, reopened, synchronize]
workflow_dispatch:
jobs:
validate-codegen:
name: Validate Code Generation
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22.x'
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
# Use the version specified in global.json
global-json-file: global.json
- name: Run CodeGen Script
shell: pwsh
run: |
Write-Host "Running code generation validation..."
./scripts/Invoke-CodeGen.ps1 -Clean
if ($LASTEXITCODE -ne 0) {
Write-Error "Code generation failed with exit code: $LASTEXITCODE"
exit $LASTEXITCODE
}
Write-Host "Code generation completed successfully!"
- name: Check for uncommitted changes
run: |
# Check if there are any changes to tracked files after code generation
if ! git diff --quiet; then
echo "::error::Code generation produced uncommitted changes. Please run the codegen script locally and commit the results."
echo "Changed files:"
git diff --name-only
echo "Diff details:"
git diff
exit 1
fi
# Also check for untracked files that might have been generated
if [ -n "$(git ls-files --others --exclude-standard)" ]; then
echo "::error::Code generation produced untracked files. Please review and commit them if they should be included."
echo "Untracked files:"
git ls-files --others --exclude-standard
exit 1
fi
echo "No uncommitted changes detected - code generation is up to date!"
- name: Run codegen visitor tests
run: dotnet test codegen/generator/test/
--configuration Release
--logger "trx;LogFilePrefix=codegen"
--results-directory ${{github.workspace}}/artifacts/test-results
${{ env.version_suffix_args}}
- name: Upload artifacts
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: build-artifacts
path: ${{github.workspace}}/artifacts