|
| 1 | +# CodeBeaver GitHub Action |
| 2 | + |
| 3 | +This action triggers CodeBeaver to generate unit tests for your pull requests automatically. CodeBeaver analyzes your code changes and creates comprehensive test suites, helping maintain high test coverage with minimal effort. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- Automatically triggers test generation on pull requests |
| 8 | +- Uses CodeBeaver's AI-powered analysis to create relevant tests |
| 9 | +- Supports all languages and frameworks that CodeBeaver supports |
| 10 | +- Integrates seamlessly with GitHub's pull request workflow |
| 11 | + |
| 12 | +## Usage |
| 13 | + |
| 14 | +1. After you [signed up for CodeBeaver](https://app.codebeaver.ai/login), get your CodeBeaver API key from the [Team page](https://app.codebeaver.ai/team). |
| 15 | + |
| 16 | +2. Add the API key to your repository's secrets: |
| 17 | + |
| 18 | + - Go to your repository's Settings |
| 19 | + - Navigate to Secrets and Variables > Actions |
| 20 | + - Create a new secret named `CODEBEAVER_API_KEY` |
| 21 | + |
| 22 | +3. Create a workflow file (e.g., `.github/workflows/codebeaver.yml`): |
| 23 | + |
| 24 | +```yaml |
| 25 | +name: CodeBeaver Test Generation |
| 26 | + |
| 27 | +on: |
| 28 | + pull_request: |
| 29 | + types: [opened, synchronize, reopened] |
| 30 | + |
| 31 | +jobs: |
| 32 | + generate-tests: |
| 33 | + runs-on: ubuntu-latest |
| 34 | + steps: |
| 35 | + - uses: codebeaver-ai/codebeaver-action@v1 |
| 36 | + with: |
| 37 | + api-key: ${{ secrets.CODEBEAVER_API_KEY }} |
| 38 | +``` |
| 39 | +
|
| 40 | +## Inputs |
| 41 | +
|
| 42 | +| Input | Description | Required | Default | |
| 43 | +| ------------ | ------------------------------- | -------- | ------------------ | |
| 44 | +| `api-key` | CodeBeaver API Key | Yes | N/A | |
| 45 | +| `repository` | Repository in owner/repo format | No | Current repository | |
| 46 | +| `pr-number` | Pull request number | No | Current PR number | |
| 47 | + |
| 48 | +## Example with all options |
| 49 | + |
| 50 | +```yaml |
| 51 | +- uses: codebeaver-ai/codebeaver-action@v1 |
| 52 | + with: |
| 53 | + api-key: ${{ secrets.CODEBEAVER_API_KEY }} |
| 54 | + repository: "octocat/Hello-World" |
| 55 | + pr-number: "123" |
| 56 | +``` |
| 57 | + |
| 58 | +## Roadmap |
| 59 | + |
| 60 | +- Trigger test generation on push |
| 61 | +- Trigger test generation on schedule |
| 62 | +- Trigger test generation on comment |
| 63 | + |
| 64 | +## Contributing |
| 65 | + |
| 66 | +Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests. |
| 67 | + |
| 68 | +## License |
| 69 | + |
| 70 | +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. |
| 71 | + |
| 72 | +--- |
| 73 | + |
| 74 | +# Contributing guidelines |
| 75 | + |
| 76 | +# CONTRIBUTING.md |
| 77 | + |
| 78 | +# Contributing to CodeBeaver GitHub Action |
| 79 | + |
| 80 | +We love your input! We want to make contributing to the CodeBeaver GitHub Action as easy and transparent as possible, whether it's: |
| 81 | + |
| 82 | +- Reporting a bug |
| 83 | +- Discussing the current state of the code |
| 84 | +- Submitting a fix |
| 85 | +- Proposing new features |
| 86 | +- Becoming a maintainer |
| 87 | + |
| 88 | +## We Develop with Github |
| 89 | + |
| 90 | +We use GitHub to host code, to track issues and feature requests, as well as accept pull requests. |
| 91 | + |
| 92 | +## We Use [Github Flow](https://guides.github.com/introduction/flow/index.html) |
| 93 | + |
| 94 | +Pull requests are the best way to propose changes to the codebase. We actively welcome your pull requests: |
| 95 | + |
| 96 | +1. Fork the repo and create your branch from `main`. |
| 97 | +2. If you've added code that should be tested, add tests. |
| 98 | +3. If you've changed APIs, update the documentation. |
| 99 | +4. Ensure the test suite passes. |
| 100 | +5. Make sure your code lints. |
| 101 | +6. Issue that pull request! |
| 102 | + |
| 103 | +## Any contributions you make will be under the MIT Software License |
| 104 | + |
| 105 | +In short, when you submit code changes, your submissions are understood to be under the same [MIT License](http://choosealicense.com/licenses/mit/) that covers the project. Feel free to contact the maintainers if that's a concern. |
| 106 | + |
| 107 | +## Report bugs using Github's [issue tracker](https://github.com/codebeaver-ai/codebeaver-action/issues) |
| 108 | + |
| 109 | +We use GitHub issues to track public bugs. Report a bug by [opening a new issue](https://github.com/codebeaver-ai/codebeaver-action/issues/new); it's that easy! |
| 110 | + |
| 111 | +## License |
| 112 | + |
| 113 | +By contributing, you agree that your contributions will be licensed under its MIT License. |
| 114 | + |
| 115 | +## References |
| 116 | + |
| 117 | +This document was adapted from the open-source contribution guidelines for [Facebook's Draft](https://github.com/facebook/draft-js/blob/a9316a723f9e918afde44dea68b5f9f39b7d9b00/CONTRIBUTING.md). |
0 commit comments