Skip to content

Commit 2be4aa3

Browse files
committed
docs(ci): Add comprehensive GitHub Actions workflows documentation
- Document all three workflows (ci.yml, docs.yml, coverage.yml) - Describe purpose, triggers, and typical duration for each workflow - Add secrets configuration guide (Cachix, Codecov tokens) - Document caching strategy for HeFFTe and Nix builds - Provide badge markdown for README integration - Add troubleshooting section for common issues - Include local testing guide using act tool - Add maintenance guide for updating compilers and dependencies - Document setup requirements for GitHub Pages and tokens
1 parent d237944 commit 2be4aa3

File tree

1 file changed

+215
-0
lines changed

1 file changed

+215
-0
lines changed

.github/workflows/README.md

Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
1+
<!--
2+
SPDX-FileCopyrightText: 2025 VTT Technical Research Centre of Finland Ltd
3+
SPDX-License-Identifier: AGPL-3.0-or-later
4+
-->
5+
6+
# GitHub Actions Workflows
7+
8+
This directory contains CI/CD workflows for the OpenPFC project.
9+
10+
## Workflows
11+
12+
### 🔧 `ci.yml` - Main CI Pipeline
13+
14+
**Runs on:** Push to master/main/develop, PRs to master/main
15+
16+
**Purpose:** Primary continuous integration pipeline ensuring code quality and functionality.
17+
18+
**Jobs:**
19+
20+
1. **Code Quality**
21+
- clang-format checking (excludes build, external dependencies)
22+
- REUSE compliance verification
23+
24+
2. **Nix Build & Test**
25+
- Runs `nix flake check`
26+
- Executes test suite (excluding benchmarks)
27+
- Uses Cachix for build caching (optional)
28+
29+
3. **CMake Build Matrix**
30+
- **OS:** Ubuntu 22.04, Ubuntu 20.04
31+
- **Compilers:** GCC 11, GCC 13, Clang 14, Clang 16
32+
- **Build Types:** Debug, Release
33+
- Caches HeFFTe installation
34+
- Runs full test suite with CTest
35+
- Uploads test logs on failure
36+
37+
4. **CI Status Check**
38+
- Required status check for merging
39+
- Aggregates results from all jobs
40+
41+
**Typical Duration:** 20-30 minutes (with cache), 45-60 minutes (cold cache)
42+
43+
---
44+
45+
### 📚 `docs.yml` - Documentation
46+
47+
**Runs on:**
48+
- Push to master/main
49+
- PRs to master/main (when docs/, include/, or README.md changed)
50+
- Manual trigger (workflow_dispatch)
51+
52+
**Purpose:** Build and deploy Doxygen documentation.
53+
54+
**Jobs:**
55+
56+
1. **Build Documentation**
57+
- Installs Doxygen, Graphviz, LaTeX
58+
- Generates HTML and PDF documentation
59+
- Checks for Doxygen warnings (fails on warnings)
60+
- Uploads documentation artifact
61+
62+
2. **Deploy to GitHub Pages** (master branch only)
63+
- Deploys to GitHub Pages
64+
- Comments deployment URL on commit
65+
- Requires Pages to be enabled in repository settings
66+
67+
**Typical Duration:** 10-15 minutes
68+
69+
**Setup Required:**
70+
1. Enable GitHub Pages in repository settings
71+
2. Set source to "GitHub Actions"
72+
73+
---
74+
75+
### 📊 `coverage.yml` - Code Coverage
76+
77+
**Runs on:**
78+
- Push to master/main/develop
79+
- PRs to master/main
80+
- Weekly schedule (Sunday 00:00 UTC)
81+
- Manual trigger (workflow_dispatch)
82+
83+
**Purpose:** Measure and report test coverage (target: >90%).
84+
85+
**Jobs:**
86+
87+
1. **Coverage Analysis**
88+
- Builds with GCC 11 + coverage flags
89+
- Runs full test suite
90+
- Generates lcov coverage report
91+
- Uploads to Codecov
92+
- Comments coverage summary on PRs
93+
- Uploads HTML coverage report artifact
94+
95+
**Coverage Targets:**
96+
- **Line Coverage:** >90%
97+
- **Function Coverage:** >90%
98+
99+
**Typical Duration:** 15-20 minutes
100+
101+
**Setup Required:**
102+
1. Create Codecov account (optional)
103+
2. Add `CODECOV_TOKEN` secret to repository
104+
3. Without token, artifact is still uploaded
105+
106+
---
107+
108+
## Secrets Configuration
109+
110+
Required secrets (configure in repository settings):
111+
112+
| Secret | Required | Purpose | Where to Get |
113+
|--------|----------|---------|--------------|
114+
| `CACHIX_AUTH_TOKEN` | Optional | Speed up Nix builds | [cachix.org](https://cachix.org) |
115+
| `CODECOV_TOKEN` | Optional | Upload coverage to Codecov | [codecov.io](https://codecov.io) |
116+
117+
---
118+
119+
## Caching Strategy
120+
121+
All workflows use GitHub Actions cache to speed up builds:
122+
123+
- **HeFFTe builds:** Cached per OS/compiler/build-type
124+
- **Nix builds:** Cached via Cachix (optional)
125+
- **Cache retention:** 7 days
126+
127+
Expected speedup: 2-3x faster on cache hits
128+
129+
---
130+
131+
## Badges
132+
133+
Add these badges to your README.md:
134+
135+
```markdown
136+
[![CI](https://github.com/VTT-ProperTune/OpenPFC/workflows/CI/badge.svg)](https://github.com/VTT-ProperTune/OpenPFC/actions/workflows/ci.yml)
137+
[![Documentation](https://github.com/VTT-ProperTune/OpenPFC/workflows/Documentation/badge.svg)](https://github.com/VTT-ProperTune/OpenPFC/actions/workflows/docs.yml)
138+
[![Coverage](https://github.com/VTT-ProperTune/OpenPFC/workflows/Coverage/badge.svg)](https://github.com/VTT-ProperTune/OpenPFC/actions/workflows/coverage.yml)
139+
[![codecov](https://codecov.io/gh/VTT-ProperTune/OpenPFC/branch/master/graph/badge.svg)](https://codecov.io/gh/VTT-ProperTune/OpenPFC)
140+
```
141+
142+
---
143+
144+
## Troubleshooting
145+
146+
### Build Matrix Failures
147+
148+
**Problem:** One compiler/OS combination fails
149+
**Solution:** Check uploaded test logs in workflow artifacts
150+
151+
### Coverage Below Threshold
152+
153+
**Problem:** Coverage drops below 90%
154+
**Solution:** Add tests for uncovered code paths, view HTML coverage report
155+
156+
### Documentation Warnings
157+
158+
**Problem:** Doxygen warnings fail the build
159+
**Solution:** Fix warnings in source code documentation, or temporarily disable check
160+
161+
### Slow Builds
162+
163+
**Problem:** Workflows take >45 minutes
164+
**Solution:**
165+
1. Ensure caching is working
166+
2. Consider reducing matrix size
167+
3. Use Cachix for Nix builds
168+
169+
---
170+
171+
## Local Testing
172+
173+
Test workflows locally before pushing:
174+
175+
```bash
176+
# Install act (GitHub Actions local runner)
177+
# https://github.com/nektos/act
178+
179+
# Run CI workflow
180+
act push
181+
182+
# Run specific job
183+
act -j build-and-test
184+
185+
# Run with specific matrix combination
186+
act -j build-and-test --matrix os:ubuntu-22.04 --matrix compiler:gcc-11
187+
```
188+
189+
---
190+
191+
## Maintenance
192+
193+
### Adding New Compilers
194+
195+
Edit `ci.yml` matrix section:
196+
197+
```yaml
198+
matrix:
199+
compiler: [gcc-11, gcc-13, gcc-14] # Add gcc-14
200+
include:
201+
- compiler: gcc-14
202+
cc: gcc-14
203+
cxx: g++-14
204+
```
205+
206+
### Updating Dependencies
207+
208+
Update version numbers in:
209+
- HeFFTe download URL: `v2.4.0` → `v2.5.0`
210+
- Cache keys: `heffte-2.4.0-...` → `heffte-2.5.0-...`
211+
- Update in all three workflows
212+
213+
---
214+
215+
**Last Updated:** 2025-12-12

0 commit comments

Comments
 (0)