Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Github action that ensures you correctly persist any changes to the samples #6536

Merged
merged 2 commits into from
Jan 13, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add a Github action that ensures you correctly persist any changes to…
… the samples
  • Loading branch information
andrewlock committed Jan 13, 2025
commit 7128b3a0037eac50ad46fbe4af374e2cc6ab9997
2 changes: 1 addition & 1 deletion .github/workflows/override_version_bump_pr_checks.yml
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ jobs:
set -o pipefail

# These checks won't run automatically on the version bump PR, so need to force this
contexts=("code_freeze" "verify_source_generators" "verify_app_trimming_descriptor_generator")
contexts=("code_freeze" "verify_source_generators" "verify_app_trimming_descriptor_generator", "verify_solution_changes_are_persisted")

sha="${{ github.sha }}"
targetUrl="https://github.com/DataDog/dd-trace-dotnet/actions/workflows/override_version_bump_pr_checks.yml"
36 changes: 36 additions & 0 deletions .github/workflows/verify_solution_changes_are_persisted.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Verify Sample solution changes have been persisted

on:
pull_request:
workflow_dispatch:

jobs:
verify_solution_changes_are_persisted:
runs-on: windows-latest
permissions:
contents: read

steps:
- name: Support longpaths
run: git config --system core.longpaths true

- name: Checkout
uses: actions/checkout@v2

- uses: actions/setup-dotnet@v1
with:
dotnet-version: '9.0.100'

- name: "Regenerating Solutions"
run: .\tracer\build.ps1 RegenerateSolutions

- name: "Verify no changes in generated solutions"
run: |
git diff --quiet
if ($LASTEXITCODE -eq 1) {
git diff
Write-Error "Found changes in generated solutions. Did you add a new sample? Regenerate the build solution locally by running the target 'RegenerateSolutions', and ensure the changed files are committed to git."
Exit 1
} else {
echo "No changes found to generated files"
}