Skip to content

Commit 2d1444f

Browse files
[DOCUMENTATION] Updates CI docs with some notes on CI variables. (- WIP PR #328 -)
Changes in file .github/workflows/CI-BUILD.yml: * Removes env.PYTHON_DEFAULT shadowing * Related work (- WIP #254 -) Changes in file docs/CI.md: * Documents new variables for #254 (- WIP PR #328 -) * Adds a few new badges (- WIP #320 -) * Implements #326
1 parent 4b497c0 commit 2d1444f

File tree

2 files changed

+56
-7
lines changed

2 files changed

+56
-7
lines changed

.github/workflows/CI-BUILD.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
persist-credentials: false
5252
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
5353
with:
54-
python-version: ${{ env.PYTHON_DEFAULT }}
54+
python-version: "${{ vars.PYTHON_DEFAULT }}"
5555
- name: Pre-Clean
5656
id: clean
5757
run: make -j1 -f Makefile purge 2>/dev/null || true
@@ -86,24 +86,24 @@ jobs:
8686
lang-var: ["de.utf-8", "jp.utf-8"]
8787
experimental: [true]
8888
include:
89-
- python-version: "3.10"
89+
- python-version: "${{ vars.PYTHON_DEFAULT }}"
9090
lang-var: "de.utf-8"
9191
experimental: false
92-
- python-version: "3.10"
92+
- python-version: "${{ vars.PYTHON_DEFAULT }}"
9393
lang-var: "jp.utf-8"
9494
experimental: false
95-
- python-version: "3.10"
95+
- python-version: "${{ vars.PYTHON_OLD_MIN }}"
9696
lang-var: "en_US.utf-8"
9797
experimental: false
98-
- python-version: "3.11"
98+
- python-version: "${{ vars.PYTHON_OLD_EXTRA }}"
9999
lang-var: "en_US.utf-8"
100100
experimental: false
101101
- python-version: "${{ vars.PYTHON_DEFAULT }}"
102102
lang-var: "en_US.utf-8"
103103
experimental: false
104-
- python-version: "3.12"
104+
- python-version: "${{ vars.PYTHON_EXPERIMENTAL }}"
105105
lang-var: "en_US.utf-8"
106-
experimental: false
106+
experimental: ${{ (needs.BUILD.environment == 'Experimenting') }}
107107
outputs:
108108
bootstrap_status: ${{ steps.bootstrap.outcome }}
109109
env:

docs/CI.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,55 @@ Continuous integration testing is handled by GitHub Actions and the generous Cir
1111
[![CodeCov](https://codecov.io/gh/reactive-firewall/multicast/graphs/sunburst.svg)](https://codecov.io/gh/reactive-firewall/multicast)
1212
[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/9458/badge)](https://app.deepsource.com/report/3f7c11ca-c203-44ec-9e01-126078f11660)
1313
[GHA Metrics](https://github.com/reactive-firewall/multicast/actions/metrics/performance?dateRangeType=DATE_RANGE_TYPE_LAST_90_DAYS)
14+
![CodeRabbit Pull Request Reviews](https://img.shields.io/coderabbit/prs/github/reactive-firewall/multicast?utm_source=oss&utm_medium=github&utm_campaign=reactive-firewall%2Fmulticast&labelColor=171717&color=FF570A&link=https%3A%2F%2Fcoderabbit.ai&label=CodeRabbit+Reviews)
15+
[![Average time to resolve an issue](https://isitmaintained.com/badge/resolution/reactive-firewall/multicast.svg)](https://isitmaintained.com/project/reactive-firewall/multicast "Average time to resolve an issue")
16+
[![Percentage of issues still open](https://isitmaintained.com/badge/open/reactive-firewall/multicast.svg)](https://isitmaintained.com/project/reactive-firewall/multicast "Percentage of issues still open")
17+
18+
## Configurable CI Variables
19+
20+
This section documents environment variables used across CI workflows to ensure consistency and
21+
simplify maintenance.
22+
23+
### Python Version Variables
24+
25+
To standardize Python version management across all CI workflows, we use a set of environment
26+
variables defined at the top of each workflow file. This approach centralizes version definitions
27+
while maintaining separation between workflows, making future updates easier and ensuring
28+
consistency.
29+
30+
#### Standard Python Version Variables
31+
32+
| Variable | Purpose | Example Value |
33+
|----------|---------|---------------|
34+
| `PYTHON_DEFAULT` | The default Python version used for single-version jobs | `"3.12"` |
35+
| `PYTHON_OLD_MIN` | Oldest/minimum Python version for cross-python portability testing | `"3.10"` |
36+
| `PYTHON_OLD_EXTRA` | Additional Python version for coverage testing | `"3.11"` |
37+
| `PYTHON_EXPERIMENTAL` | Future/experimental Python version for optional testing | `"3.13"` |
38+
39+
#### Usage Examples
40+
41+
##### Setting up Python with the default version
42+
43+
```yaml
44+
- uses: actions/setup-python@v5
45+
with:
46+
python-version: "${{ vars.PYTHON_DEFAULT }}"
47+
```
48+
49+
##### Using matrix strategy for multi-version testing
50+
51+
```yaml
52+
jobs:
53+
test:
54+
strategy:
55+
fail-fast: false
56+
matrix:
57+
python-version: ["${{ vars.PYTHON_DEFAULT }}", "${{ vars.PYTHON_EXPERIMENTAL }}"]
58+
steps:
59+
- uses: actions/setup-python@v5
60+
with:
61+
python-version: ${{ matrix.python-version }}
62+
```
1463
1564
## Testing
1665

0 commit comments

Comments
 (0)