From deed72cc9b424a80868f0737194e486e1c232f28 Mon Sep 17 00:00:00 2001 From: Stefan Roiser Date: Sat, 22 Nov 2025 19:19:45 +0100 Subject: [PATCH 1/7] new file --- .github/workflows/mg5_ghci.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/mg5_ghci.yml diff --git a/.github/workflows/mg5_ghci.yml b/.github/workflows/mg5_ghci.yml new file mode 100644 index 0000000000..aab8ea1643 --- /dev/null +++ b/.github/workflows/mg5_ghci.yml @@ -0,0 +1,15 @@ +name: ghci + +on: + push: + branches: [ $default-branch ] + +jobs: + test: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: hello world + run: echo hello world From e0d163c751dcc9265aee6233b97ee80b58c9c627 Mon Sep 17 00:00:00 2001 From: Stefan Roiser Date: Sat, 22 Nov 2025 19:23:08 +0100 Subject: [PATCH 2/7] change branch --- .github/workflows/mg5_ghci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mg5_ghci.yml b/.github/workflows/mg5_ghci.yml index aab8ea1643..4526f511c4 100644 --- a/.github/workflows/mg5_ghci.yml +++ b/.github/workflows/mg5_ghci.yml @@ -2,7 +2,7 @@ name: ghci on: push: - branches: [ $default-branch ] + branches: ghci jobs: test: From d4aa20c898269d82a10a30b1b59569d7609ae368 Mon Sep 17 00:00:00 2001 From: Stefan Roiser Date: Sun, 23 Nov 2025 19:44:49 +0100 Subject: [PATCH 3/7] pwd --- .github/workflows/mg5_ghci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mg5_ghci.yml b/.github/workflows/mg5_ghci.yml index 4526f511c4..50bc111e0a 100644 --- a/.github/workflows/mg5_ghci.yml +++ b/.github/workflows/mg5_ghci.yml @@ -12,4 +12,4 @@ jobs: steps: - uses: actions/checkout@v4 - name: hello world - run: echo hello world + run: echo hello world && echo `pwd` From 94d117801908e8b7b795ae538c42ea32c7122b20 Mon Sep 17 00:00:00 2001 From: Stefan Roiser Date: Sun, 23 Nov 2025 19:46:27 +0100 Subject: [PATCH 4/7] Enhance hello world step with directory listing --- .github/workflows/mg5_ghci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mg5_ghci.yml b/.github/workflows/mg5_ghci.yml index 50bc111e0a..efa4b34575 100644 --- a/.github/workflows/mg5_ghci.yml +++ b/.github/workflows/mg5_ghci.yml @@ -12,4 +12,4 @@ jobs: steps: - uses: actions/checkout@v4 - name: hello world - run: echo hello world && echo `pwd` + run: echo hello world && echo `pwd` && echo `ls` From 74369ac53b8f50af6f9bdb4efcb58a337f0e7848 Mon Sep 17 00:00:00 2001 From: Stefan Roiser Date: Wed, 26 Nov 2025 14:32:04 +0100 Subject: [PATCH 5/7] update submodule --- .github/workflows/mg5_ghci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mg5_ghci.yml b/.github/workflows/mg5_ghci.yml index efa4b34575..196293db22 100644 --- a/.github/workflows/mg5_ghci.yml +++ b/.github/workflows/mg5_ghci.yml @@ -12,4 +12,4 @@ jobs: steps: - uses: actions/checkout@v4 - name: hello world - run: echo hello world && echo `pwd` && echo `ls` + run: echo hello world && echo `pwd` && echo `ls` && echo Environment\n\n && printenv From b44ec70bff15d6bda276ddec0c83efde655ee67b Mon Sep 17 00:00:00 2001 From: Stefan Roiser Date: Thu, 8 Jan 2026 17:59:48 +0100 Subject: [PATCH 6/7] fix process --- test/processes/pp_ttx/launch.mg5 | 6 ++++++ test/processes/pp_ttx/output.mg5 | 2 ++ 2 files changed, 8 insertions(+) create mode 100644 test/processes/pp_ttx/launch.mg5 create mode 100644 test/processes/pp_ttx/output.mg5 diff --git a/test/processes/pp_ttx/launch.mg5 b/test/processes/pp_ttx/launch.mg5 new file mode 100644 index 0000000000..2acf6a78e1 --- /dev/null +++ b/test/processes/pp_ttx/launch.mg5 @@ -0,0 +1,6 @@ +launch PROC_pp_ttx +set vector_size 32 +set nevents 25k +set sde_strategy 1 +set gridpack True + diff --git a/test/processes/pp_ttx/output.mg5 b/test/processes/pp_ttx/output.mg5 new file mode 100644 index 0000000000..0299c86959 --- /dev/null +++ b/test/processes/pp_ttx/output.mg5 @@ -0,0 +1,2 @@ +generate p p > t t~ +output madevent_simd PROC_pp_ttx From 361fe98fb72a21c7d1be29b2e612fa46602915df Mon Sep 17 00:00:00 2001 From: Stefan Roiser Date: Fri, 9 Jan 2026 11:45:58 +0100 Subject: [PATCH 7/7] move ci file --- .github/workflows/mg5_codegen.yml | 102 ++++++++++++++++++++++++++++++ .github/workflows/mg5_ghci.yml | 15 ----- 2 files changed, 102 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/mg5_codegen.yml delete mode 100644 .github/workflows/mg5_ghci.yml diff --git a/.github/workflows/mg5_codegen.yml b/.github/workflows/mg5_codegen.yml new file mode 100644 index 0000000000..5cbd0f0952 --- /dev/null +++ b/.github/workflows/mg5_codegen.yml @@ -0,0 +1,102 @@ +name: Code Generator CI + +on: + pull_request: + types: [opened, synchronize, reopened] + +jobs: + generate-and-check: + runs-on: ubuntu-latest + + steps: + - name: Checkout codegen repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Run code generator + run: | + chmod +x codegen.sh + ./codegen.sh + + - name: Check code format with clang-format + id: format-check + run: | + # Find all generated C/C++ files (adjust pattern as needed) + find . -type f \( -name "*.c" -o -name "*.cpp" -o -name "*.h" -o -name "*.hpp" \) > files.txt + + # Run clang-format check + if clang-format --dry-run --Werror $(cat files.txt) 2>&1 | tee format-output.txt; then + echo "format_ok=true" >> $GITHUB_OUTPUT + echo "✅ Code is properly formatted" + else + echo "format_ok=false" >> $GITHUB_OUTPUT + echo "❌ Code needs formatting" + + # Generate the diff for needed changes + clang-format -i $(cat files.txt) + git diff > format-changes.patch + fi + + - name: Commit to target repository + if: steps.format-check.outputs.format_ok == 'true' + env: + TARGET_REPO: your-username/target-repo # Change this + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Or use a PAT: secrets.TARGET_REPO_PAT + run: | + # Configure git + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + + # Clone target repo + git clone https://x-access-token:${GH_TOKEN}@github.com/${TARGET_REPO}.git target-repo + cd target-repo + + # Create branch based on PR number + BRANCH_NAME="codegen-pr-${{ github.event.pull_request.number }}" + git checkout -b ${BRANCH_NAME} + + # Copy generated files (adjust paths as needed) + cp -r ../generated-output/* . + + # Commit and push + git add . + git commit -m "Code generated from PR #${{ github.event.pull_request.number }}" \ + -m "Source PR: ${{ github.event.pull_request.html_url }}" + git push origin ${BRANCH_NAME} + + echo "✅ Pushed to ${TARGET_REPO} on branch ${BRANCH_NAME}" + + - name: Comment on PR with format issues + if: steps.format-check.outputs.format_ok == 'false' + uses: actions/github-script@v7 + with: + script: | + const fs = require('fs'); + const patch = fs.readFileSync('format-changes.patch', 'utf8'); + + const comment = `## ❌ Code Format Check Failed + + The generated code does not conform to clang-format rules. + +
+ Required formatting changes + + \`\`\`diff + ${patch} + \`\`\` + +
+ + Please update your code generator to produce properly formatted code.`; + + github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + body: comment + }); + + - name: Fail if format check failed + if: steps.format-check.outputs.format_ok == 'false' + run: exit 1 diff --git a/.github/workflows/mg5_ghci.yml b/.github/workflows/mg5_ghci.yml deleted file mode 100644 index 196293db22..0000000000 --- a/.github/workflows/mg5_ghci.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: ghci - -on: - push: - branches: ghci - -jobs: - test: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: hello world - run: echo hello world && echo `pwd` && echo `ls` && echo Environment\n\n && printenv