feat(ci): add GitHub Actions workflow with code coverage#3
Conversation
- Add CI workflow testing on Neovim v0.11.0 and nightly - Configure luacov for code coverage tracking - Add coverage upload to Codecov - Create test-coverage.sh script for coverage collection 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary of ChangesHello @AnnatarHe, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request establishes a robust Continuous Integration (CI) pipeline using GitHub Actions. Its primary goal is to enhance code quality by automating tests across different Neovim versions and integrating code coverage tracking with luacov. The collected coverage data is then uploaded to Codecov, providing a clear overview of test effectiveness and helping maintain high standards for the codebase. Highlights
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces code coverage reporting by adding a .luacov configuration and a test-coverage.sh script to run tests and generate a coverage report. The changes are a great step towards improving code quality and testability. I have a couple of suggestions for the test-coverage.sh script to enhance its robustness and adherence to shell scripting best practices.
| # Run tests with code coverage using luacov | ||
| # Requires: luacov, luacov-reporter-lcov installed via luarocks | ||
|
|
||
| set -e |
There was a problem hiding this comment.
| luacov -r lcov -o lcov.info | ||
| echo "Coverage report generated: lcov.info" | ||
| else | ||
| echo "Warning: No coverage stats generated" |
There was a problem hiding this comment.
It's a good practice to redirect warning and error messages to standard error (stderr). This allows for better separation of normal output from error messages, which can be useful for logging and redirection in CI environments.
| echo "Warning: No coverage stats generated" | |
| echo "Warning: No coverage stats generated" >&2 |
The tests require 'tests.helpers' but the package path only included the tests/ directory, causing resolution to fail in CI environment. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create coverage_init.lua to load luacov before test code - Save coverage stats on VimLeavePre autocmd - Set LUA_PATH/LUA_CPATH env vars for luarocks modules - Don't fail CI if coverage stats unavailable 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary
Test plan
🤖 Generated with Claude Code