Skip to content

Commit 3e11f6c

Browse files
authored
Merge pull request #7 from apalis-dev/copilot/add-ci-cd-configuration
Add comprehensive CI/CD infrastructure for repository management
2 parents 1d95daf + dd21475 commit 3e11f6c

29 files changed

Lines changed: 1564 additions & 1806 deletions

.gitattributes

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Set default behavior to automatically normalize line endings
2+
* text=auto
3+
4+
# Rust files
5+
*.rs text diff=rust
6+
7+
# Web files
8+
*.js text
9+
*.json text
10+
*.html text
11+
*.css text
12+
*.md text
13+
14+
# Configuration files
15+
*.toml text
16+
*.yml text
17+
*.yaml text
18+
19+
# Shell scripts
20+
*.sh text eol=lf
21+
22+
# Binary files
23+
*.png binary
24+
*.jpg binary
25+
*.jpeg binary
26+
*.gif binary
27+
*.ico binary
28+
*.svg binary
29+
*.wasm binary
30+
*.ttf binary
31+
*.woff binary
32+
*.woff2 binary

.github/CI_CD_INFRASTRUCTURE.md

Lines changed: 220 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
# CI/CD Infrastructure
2+
3+
This document provides an overview of the CI/CD infrastructure for apalis-board.
4+
5+
## Overview
6+
7+
The apalis-board repository uses GitHub Actions for continuous integration, deployment, and automated maintenance. The infrastructure is designed to ensure code quality, security, and reliability.
8+
9+
## Workflows
10+
11+
### Core CI Workflows
12+
13+
#### 1. All Checks (`ci.yml`)
14+
**Trigger**: Push to master/main, Pull Requests
15+
**Purpose**: Combined workflow that serves as the main status check
16+
17+
This workflow runs:
18+
- Rust compilation checks
19+
- Test suite
20+
- Code formatting validation
21+
- Clippy linting
22+
- Frontend build
23+
- Security audit
24+
25+
**Status**: This is the primary status check for PRs
26+
27+
#### 2. Rust CI (`rust-ci.yml`)
28+
**Trigger**: Push to master/main, Pull Requests
29+
**Purpose**: Comprehensive Rust quality checks
30+
31+
Jobs:
32+
- **check**: Verifies all crates compile
33+
- **test**: Runs test suites for types and api crates
34+
- **fmt**: Validates code formatting with rustfmt
35+
- **clippy**: Lints code with clippy
36+
- **features**: Tests feature combinations (actix, axum)
37+
38+
#### 3. Frontend Build (`frontend-build.yml`)
39+
**Trigger**: Push to master/main, Pull Requests
40+
**Purpose**: Builds the Leptos WASM frontend
41+
42+
Steps:
43+
1. Install Rust with wasm32-unknown-unknown target
44+
2. Install Trunk (WASM bundler)
45+
3. Install npm dependencies (Tailwind CSS)
46+
4. Build frontend with Trunk
47+
5. Upload build artifacts
48+
49+
### Release Workflow
50+
51+
#### 4. Release (`release.yml`)
52+
**Trigger**: Version tags (v*.*.*)
53+
**Purpose**: Automated release creation and artifact publishing
54+
55+
The workflow:
56+
1. Creates a GitHub release
57+
2. Builds frontend and packages as tar.gz
58+
3. Builds and packages Rust crates
59+
4. Uploads all artifacts to the release
60+
61+
**Usage**: Push a version tag to trigger
62+
```bash
63+
git tag -a v1.0.0 -m "Release v1.0.0"
64+
git push origin v1.0.0
65+
```
66+
67+
### Security and Quality
68+
69+
#### 5. Security Audit (`security.yml`)
70+
**Trigger**:
71+
- Push/PR on Cargo.toml or Cargo.lock changes
72+
- Weekly schedule (Mondays at 9 AM UTC)
73+
74+
Jobs:
75+
- **audit**: Scans for security vulnerabilities with cargo-audit
76+
- **deny**: Checks dependencies with cargo-deny for:
77+
- Known security advisories
78+
- License compliance
79+
- Banned/yanked crates
80+
- Multiple versions of same crate
81+
82+
#### 6. Code Coverage (`coverage.yml`)
83+
**Trigger**: Push to master/main, Pull Requests
84+
**Purpose**: Generates and reports code coverage
85+
86+
Uses:
87+
- cargo-tarpaulin for coverage generation
88+
- Codecov for coverage reporting and tracking
89+
90+
#### 7. Documentation Check (`docs.yml`)
91+
**Trigger**:
92+
- Push/PR to master/main
93+
- Weekly schedule (Sundays at midnight UTC)
94+
95+
Jobs:
96+
- **link-check**: Validates markdown links
97+
- **rustdoc**: Builds Rust documentation with warnings as errors
98+
99+
### Maintenance
100+
101+
#### 8. Tailwind CSS Check (`nodejs.yml`)
102+
**Trigger**: Push to master/main, Pull Requests
103+
**Purpose**: Validates npm dependencies
104+
105+
Checks:
106+
- Installs npm dependencies
107+
- Checks for outdated packages
108+
- Runs security audit
109+
110+
#### 9. Cache Warmup (`cache-warmup.yml`)
111+
**Trigger**:
112+
- Weekly schedule (Sundays at midnight UTC)
113+
- Manual workflow dispatch
114+
115+
**Purpose**: Pre-warms caches to improve CI performance
116+
117+
Jobs:
118+
- Builds all Rust crates to populate cargo cache
119+
- Installs npm dependencies to populate npm cache
120+
121+
#### 10. Dependabot Configuration (`dependabot.yml`)
122+
**Schedule**: Weekly (Mondays)
123+
**Purpose**: Automated dependency updates
124+
125+
Monitors:
126+
- Cargo dependencies (Rust)
127+
- npm dependencies (Tailwind CSS)
128+
- GitHub Actions versions
129+
130+
Creates PRs for updates grouped by ecosystem.
131+
132+
## Caching Strategy
133+
134+
The CI uses multiple caching strategies:
135+
136+
1. **Rust Cache** (Swatinem/rust-cache@v2)
137+
- Caches compiled dependencies
138+
- Shared across workflows with `shared-key`
139+
- Significantly reduces build times
140+
141+
2. **npm Cache**
142+
- Built into setup-node action
143+
- Caches node_modules dependencies
144+
145+
3. **Weekly Warmup**
146+
- Refreshes caches weekly
147+
- Ensures CI has latest pre-compiled dependencies
148+
149+
## Security Features
150+
151+
1. **cargo-audit**: Checks for known security vulnerabilities
152+
2. **cargo-deny**: Enforces security and licensing policies
153+
3. **Dependabot**: Automated security updates
154+
4. **npm audit**: Checks npm dependencies for vulnerabilities
155+
156+
## Status Badges
157+
158+
The README includes badges for:
159+
- All Checks status
160+
- Rust CI status
161+
- Frontend Build status
162+
- Security Audit status
163+
- Code Coverage percentage
164+
165+
## Troubleshooting
166+
167+
### Workflow Failures
168+
169+
**Rust CI fails on formatting**:
170+
```bash
171+
cargo fmt --all
172+
```
173+
174+
**Rust CI fails on clippy**:
175+
```bash
176+
cargo clippy --workspace --all-features
177+
```
178+
179+
**Frontend build fails**:
180+
```bash
181+
cd crates/board
182+
trunk build
183+
```
184+
185+
**Tests fail**:
186+
```bash
187+
cargo test --workspace
188+
```
189+
190+
### Common Issues
191+
192+
1. **Workspace member not found**: Examples are excluded from workspace as they depend on external repos
193+
2. **Cache issues**: Manually trigger cache-warmup workflow or wait for weekly refresh
194+
3. **Outdated dependencies**: Wait for Dependabot PRs or run `cargo update` / `npm update`
195+
196+
## Manual Triggers
197+
198+
Some workflows can be triggered manually:
199+
200+
1. **Cache Warmup**: Go to Actions → Cache Warmup → Run workflow
201+
2. **Release**: Push a version tag (preferred over manual trigger)
202+
203+
## Contributing
204+
205+
When contributing, ensure:
206+
- All CI checks pass before requesting review
207+
- Follow the PR template
208+
- Update documentation if needed
209+
- Add tests for new features
210+
211+
For more details, see [CONTRIBUTING.md](../CONTRIBUTING.md).
212+
213+
## Future Improvements
214+
215+
Potential enhancements:
216+
- [ ] Nightly builds for testing against Rust nightly
217+
- [ ] Performance benchmarking
218+
- [ ] Automated changelog generation
219+
- [ ] Deploy previews for frontend changes
220+
- [ ] Integration tests with example services
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
name: Bug Report
3+
about: Create a report to help us improve
4+
title: '[BUG] '
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
## Bug Description
10+
11+
A clear and concise description of what the bug is.
12+
13+
## To Reproduce
14+
15+
Steps to reproduce the behavior:
16+
1. Go to '...'
17+
2. Click on '...'
18+
3. Scroll down to '...'
19+
4. See error
20+
21+
## Expected Behavior
22+
23+
A clear and concise description of what you expected to happen.
24+
25+
## Actual Behavior
26+
27+
A clear and concise description of what actually happened.
28+
29+
## Screenshots
30+
31+
If applicable, add screenshots to help explain your problem.
32+
33+
## Environment
34+
35+
- OS: [e.g., macOS, Linux, Windows]
36+
- Rust version: [e.g., 1.70.0]
37+
- Node.js version: [e.g., 20.0.0]
38+
- Browser (if frontend issue): [e.g., Chrome 115, Firefox 115]
39+
40+
## Additional Context
41+
42+
Add any other context about the problem here.
43+
44+
## Logs
45+
46+
```
47+
Paste any relevant logs here
48+
```

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: GitHub Discussions
4+
url: https://github.com/apalis-dev/apalis-board/discussions
5+
about: Ask questions and discuss ideas with the community
6+
- name: Apalis Core Repository
7+
url: https://github.com/geofmureithi/apalis
8+
about: For issues related to the apalis core library
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: Documentation Issue
3+
about: Report an issue with documentation
4+
title: '[DOCS] '
5+
labels: documentation
6+
assignees: ''
7+
---
8+
9+
## Documentation Issue
10+
11+
Describe the documentation issue clearly.
12+
13+
## Location
14+
15+
Where is the documentation issue located?
16+
- [ ] README.md
17+
- [ ] CONTRIBUTING.md
18+
- [ ] Code comments
19+
- [ ] Rustdoc
20+
- [ ] Examples
21+
- [ ] Other:
22+
23+
## Current Documentation
24+
25+
What does the current documentation say?
26+
27+
## Suggested Improvement
28+
29+
What should it say instead?
30+
31+
## Additional Context
32+
33+
Add any other context about the documentation issue here.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
name: Feature Request
3+
about: Suggest an idea for this project
4+
title: '[FEATURE] '
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
## Feature Description
10+
11+
A clear and concise description of the feature you'd like to see.
12+
13+
## Problem Statement
14+
15+
Is your feature request related to a problem? Please describe.
16+
<!-- e.g., I'm always frustrated when [...] -->
17+
18+
## Proposed Solution
19+
20+
Describe the solution you'd like.
21+
22+
## Alternatives Considered
23+
24+
Describe any alternative solutions or features you've considered.
25+
26+
## Benefits
27+
28+
What are the benefits of implementing this feature?
29+
-
30+
-
31+
32+
## Implementation Ideas
33+
34+
If you have ideas about how to implement this, please share them.
35+
36+
## Additional Context
37+
38+
Add any other context, screenshots, or examples about the feature request here.
39+
40+
## Would you be willing to implement this?
41+
42+
- [ ] Yes, I can submit a PR
43+
- [ ] No, but I can help test
44+
- [ ] I need guidance on how to implement this

0 commit comments

Comments
 (0)