Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Proposal: Add an LLGo test workflow only when a binding project has tests

未关闭
#994 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
github-actions, go
领域
ci-cd, tooling

调研方向

Start with the project template that #974 introduced and the generation path that llcppg -init runs, then read the existing llcppg CI workflow at .github/workflows/llgo.yml as the reference setup. The open question, whether this belongs in ordinary generation or in an explicit template-sync command, needs a maintainer decision before any code. Done means a project with no *_test.go gets no workflow, one with tests gets it, and regeneration never overwrites a customized file.

由索引模型根据 Issue 内容生成。

描述

feature proposal

Summary

Add an llgo.yml workflow to the llcppg project template. When llcppg applies the template to a binding project, it should create .github/workflows/llgo.yml only if the target Go module contains at least one *_test.go file. The workflow runs llgo test ./... on pushes and pull requests. Projects without tests should not receive the workflow file.

Motivation

The template introduced in #974 gives new binding repositories a consistent starting point. Once a project adds tests, those tests should run automatically in CI using LLGo, as llcppg itself does. Adding a test workflow to every new repository would create a CI job that has nothing to test. Making the workflow conditional keeps the initial repository small while enabling CI when tests exist.

Proposed behavior

  • Keep llgo.yml as a source file in the template. Materialize it at .github/workflows/llgo.yml in the target repository only when a *_test.go file exists under the target Go module.
  • Check after generation has written its files, so the decision reflects the project’s current contents. A fresh llcppg -init repository has no tests and therefore receives no workflow.
  • If tests are added later, the next template synchronization or generation run adds the workflow. The command should report when it does so.
  • If no tests exist, leave .github/workflows/llgo.yml absent. Do not delete an existing workflow: it may contain project-specific changes.
  • Do not overwrite an existing llgo.yml when applying the template.

The generated workflow should set up the required Go, LLVM, and LLGo toolchain, then run llgo test ./... from the module root. Its setup can follow the existing [llcppg CI workflow](https://github.com/goplus/llcppg/blob/main/.github/workflows/llgo.yml), adapted so it works in a generated binding repository.

Testing plan

Verify that a project with no *_test.go receives no workflow; a project with a test in the module root or a subpackage receives llgo.yml; and running generation again does not overwrite a customized workflow. Finally, run the generated workflow against a small binding project with a passing test.

Open question

Should adding the workflow be part of ordinary generation, or should template synchronization have an explicit command? Checking only during llcppg -init would miss the common case where tests are written after initialization.

主要语言
Go
星标
39
派生
13
平均合并
1 小时 33 分钟
30 天内合并 PR
256

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

goplus/llcppg 的其他 Issue

查看 goplus/llcppg 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。