🤖 feat: implement trunk-based CI/CD with local testing
- Designed trunk-based development workflow with branch protection - Added workflow validation job to prevent main branch breaks - Integrated act (GitHub Actions runner) for local Gitea workflow testing - Created unified CI/CD script interface (scripts/cicd.sh) - Added YAML lint configuration with practical limits (400 chars) - Organized all CI/CD scripts under scripts/cicd/ directory - Confirmed Gitea/GitHub Actions compatibility via local testing - Updated ADR 0017 with implementation details and test results - Enhanced documentation with local development workflow See ADR-0017 for complete trunk-based development workflow documentation. See ADR-0016 for CI/CD pipeline design.
This commit is contained in:
187
STATUS_BADGES.md
Normal file
187
STATUS_BADGES.md
Normal file
@@ -0,0 +1,187 @@
|
||||
# CI/CD Status Badges
|
||||
|
||||
This document provides badge examples for different CI/CD platforms and code quality services.
|
||||
|
||||
## Gitea (Primary Platform)
|
||||
|
||||
```markdown
|
||||
[](https://gitea.arcodange.fr/arcodange/DanceLessonsCoach)
|
||||
[](https://gitea.arcodange.fr/arcodange/DanceLessonsCoach/-/pipelines)
|
||||
```
|
||||
|
||||
**Configuration Notes:**
|
||||
- **Organization**: `arcodange`
|
||||
- **Repository**: `DanceLessonsCoach`
|
||||
- **Internal URL** (for CI/CD scripts): `https://gitea.arcodange.lab/`
|
||||
- **External URL** (for public badges): `https://gitea.arcodange.fr/`
|
||||
- **SSH URL**: `ssh://git@192.168.1.202:2222/arcodange/DanceLessonsCoach.git`
|
||||
- **Badge API**: Uses external domain with full org/repo path
|
||||
- **CI/CD Configuration**: Uses internal domain for faster network access
|
||||
|
||||
## GitHub Mirror
|
||||
|
||||
```markdown
|
||||
[](https://github.com/yourorg/DanceLessonsCoach/actions)
|
||||
[](https://github.com/yourorg/DanceLessonsCoach/issues)
|
||||
[](https://github.com/yourorg/DanceLessonsCoach/stargazers)
|
||||
[](https://github.com/yourorg/DanceLessonsCoach/blob/main/LICENSE)
|
||||
```
|
||||
|
||||
**Replace** `yourorg` with your actual GitHub organization/user name.
|
||||
|
||||
## GitLab Mirror
|
||||
|
||||
```markdown
|
||||
[](https://gitlab.com/yourorg/DanceLessonsCoach/-/pipelines)
|
||||
[](https://gitlab.com/yourorg/DanceLessonsCoach/-/commits/main)
|
||||
```
|
||||
|
||||
**Replace** `yourorg` with your actual GitLab organization/user name.
|
||||
|
||||
## Code Quality Badges
|
||||
|
||||
### Go Report Card
|
||||
|
||||
```markdown
|
||||
[](https://goreportcard.com/report/github.com/yourorg/DanceLessonsCoach)
|
||||
```
|
||||
|
||||
### Code Coverage (Codecov)
|
||||
|
||||
```markdown
|
||||
[](https://codecov.io/gh/yourorg/DanceLessonsCoach)
|
||||
```
|
||||
|
||||
### Code Climate
|
||||
|
||||
```markdown
|
||||
[](https://codeclimate.com/github/yourorg/DanceLessonsCoach)
|
||||
[](https://codeclimate.com/github/yourorg/DanceLessonsCoach)
|
||||
```
|
||||
|
||||
## Version Badges
|
||||
|
||||
```markdown
|
||||
[](https://github.com/yourorg/DanceLessonsCoach/releases/latest)
|
||||
[](https://github.com/yourorg/DanceLessonsCoach/releases/latest)
|
||||
[](https://github.com/yourorg/DanceLessonsCoach/blob/main/go.mod)
|
||||
```
|
||||
|
||||
## Combined Badge Example
|
||||
|
||||
Here's how to combine multiple badges in your README:
|
||||
|
||||
```markdown
|
||||
# DanceLessonsCoach
|
||||
|
||||
[](https://ci.your-gitea-instance.com)
|
||||
[](https://github.com/yourorg/DanceLessonsCoach/actions)
|
||||
[](https://gitlab.com/yourorg/DanceLessonsCoach/-/pipelines)
|
||||
|
||||
[](https://goreportcard.com/report/github.com/yourorg/DanceLessonsCoach)
|
||||
[](https://codecov.io/gh/yourorg/DanceLessonsCoach)
|
||||
|
||||
[](https://github.com/yourorg/DanceLessonsCoach/releases/latest)
|
||||
[](https://github.com/yourorg/DanceLessonsCoach/blob/main/go.mod)
|
||||
[](https://github.com/yourorg/DanceLessonsCoach/blob/main/LICENSE)
|
||||
```
|
||||
|
||||
## Setup Instructions
|
||||
|
||||
### For Gitea (Arcodange Configuration)
|
||||
|
||||
```bash
|
||||
# 1. Configure CI/CD runners to use INTERNAL URL
|
||||
export GITEA_URL="https://gitea.arcodange.lab/"
|
||||
export GITEA_ORG="arcodange"
|
||||
export GITEA_REPO="DanceLessonsCoach"
|
||||
|
||||
# 2. Enable GitHub Actions compatibility in repo settings
|
||||
# - Go to: https://gitea.arcodange.lab/arcodange/DanceLessonsCoach/settings/actions
|
||||
# - Enable GitHub Actions
|
||||
# - Configure runner to use internal network (192.168.1.202)
|
||||
|
||||
# 3. Workflow files are in .gitea/workflows/ (not .github/workflows/)
|
||||
# - Main workflow: .gitea/workflows/ci-cd.yaml
|
||||
# - Follows Arcodange conventions from webapp workflow
|
||||
|
||||
# 4. Use EXTERNAL URL for public badges
|
||||
# - Badge API: https://gitea.arcodange.fr/api/badges/arcodange/DanceLessonsCoach/status
|
||||
# - Public access: https://gitea.arcodange.fr/arcodange/DanceLessonsCoach
|
||||
# - SSH access: ssh://git@192.168.1.202:2222/arcodange/DanceLessonsCoach.git
|
||||
```
|
||||
|
||||
### For CI/CD Configuration Files
|
||||
|
||||
```yaml
|
||||
# .github/workflows/main.yml
|
||||
# Arcodange-specific environment variables
|
||||
env:
|
||||
GITEA_INTERNAL: "https://gitea.arcodange.lab/"
|
||||
GITEA_EXTERNAL: "https://gitea.arcodange.fr/"
|
||||
GITEA_ORG: "arcodange"
|
||||
GITEA_REPO: "DanceLessonsCoach"
|
||||
GITEA_SSH: "ssh://git@192.168.1.202:2222/arcodange/DanceLessonsCoach.git"
|
||||
```
|
||||
|
||||
### For Badge Usage
|
||||
|
||||
```markdown
|
||||
# Always use EXTERNAL URL with full org/repo path for badges in README
|
||||
[](https://gitea.arcodange.fr/arcodange/DanceLessonsCoach)
|
||||
[](https://gitea.arcodange.fr/arcodange/DanceLessonsCoach/-/pipelines)
|
||||
```
|
||||
|
||||
### For GitHub
|
||||
1. Enable GitHub Actions on your mirror repository
|
||||
2. Badges will automatically work with the provided URLs
|
||||
3. Configure branch protection rules as needed
|
||||
|
||||
### For GitLab
|
||||
1. Create a `.gitlab-ci.yml` file (can convert from GitHub Actions)
|
||||
2. Enable pipeline badges in GitLab CI/CD settings
|
||||
3. Use the provided badge URLs
|
||||
|
||||
### For External Services
|
||||
1. **Go Report Card**: Just visit https://goreportcard.com/report/github.com/yourorg/DanceLessonsCoach
|
||||
2. **Codecov**: Sign up at codecov.io and integrate with your repository
|
||||
3. **Code Climate**: Sign up and add your repository
|
||||
|
||||
## Badge Customization
|
||||
|
||||
You can customize badge appearance using shield.io parameters:
|
||||
|
||||
```markdown
|
||||
[](https://example.com)
|
||||
```
|
||||
|
||||
**Style options:** `flat`, `flat-square`, `plastic`, `for-the-badge`, `social`
|
||||
**Color options:** Any hex color or named color (blue, green, red, etc.)
|
||||
**Logo options:** Add `?logo=go`, `?logo=github`, etc.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Badges not updating
|
||||
- Check if CI/CD pipelines are running successfully
|
||||
- Verify badge URLs are correct
|
||||
- Ensure your repository is public (for external services)
|
||||
- Check for caching issues (add cache buster if needed)
|
||||
|
||||
### Broken badge links
|
||||
- Verify the platform URLs are correct
|
||||
- Check repository visibility settings
|
||||
- Ensure CI/CD is properly configured
|
||||
- Test badge URLs in browser first
|
||||
|
||||
## References
|
||||
|
||||
- [Shields.io Badge Documentation](https://shields.io/)
|
||||
- [GitHub Actions Badges](https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/adding-a-workflow-status-badge)
|
||||
- [GitLab CI/CD Badges](https://docs.gitlab.com/ee/ci/pipelines/settings.html#pipeline-status-badges)
|
||||
- [Gitea Actions Documentation](https://docs.gitea.com/next/usage/actions/)
|
||||
- [Go Report Card](https://goreportcard.com/)
|
||||
- [Codecov Documentation](https://docs.codecov.com/)
|
||||
|
||||
---
|
||||
|
||||
**Note:** Replace all placeholder URLs (`yourorg`, `your-gitea-instance.com`) with your actual repository and instance information.
|
||||
Reference in New Issue
Block a user