Skip to content

Commit 3a2e6dd

Browse files
committed
chore: production-ready CI/CD
Apply the production-ready CI/CD plan: - Phase 1: cross-cutting workflow fixes (action version pins, book-build path fix, video-build dynamic version + guards, permissions+concurrency blocks) - Phase 2: per-repo CI hardening (drop continue-on-error, add OS/compiler matrices, fix repo-specific bugs) - Phase 3: complete release matrix (Linux/Windows/macOS/embedded binaries, real CycloneDX + SPDX SBOMs via anchore/sbom-action, cosign keyless signing, conditional Apple notarization / Authenticode / GPG signing gated on secrets) All workflow files pass actionlint clean.
1 parent 5e7ab3c commit 3a2e6dd

9 files changed

Lines changed: 254 additions & 115 deletions

File tree

.github/workflows/book-build.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,20 @@ jobs:
4242
- name: Check book source
4343
id: check
4444
run: |
45-
if [ ! -f book.md ]; then
45+
if [ ! -f docs/book/book.md ]; then
4646
echo "has_book=false" >> $GITHUB_OUTPUT
4747
echo "lines=0" >> $GITHUB_OUTPUT
4848
echo "images=0" >> $GITHUB_OUTPUT
4949
echo "tables=0" >> $GITHUB_OUTPUT
50-
echo "WARNING: book.md not found"
50+
echo "WARNING: docs/book/book.md not found"
5151
exit 0
5252
fi
5353
echo "has_book=true" >> $GITHUB_OUTPUT
54-
LINES=$(wc -l < book.md)
55-
IMAGES=$(grep -c '!\[' book.md || echo 0)
56-
TABLES=$(grep -c '^|' book.md || echo 0)
57-
CODE=$(grep -c '```' book.md || echo 0)
58-
CHAPTERS=$(grep -c '^## ' book.md || echo 0)
54+
LINES=$(wc -l < docs/book/book.md)
55+
IMAGES=$(grep -c '!\[' docs/book/book.md || echo 0)
56+
TABLES=$(grep -c '^|' docs/book/book.md || echo 0)
57+
CODE=$(grep -c '```' docs/book/book.md || echo 0)
58+
CHAPTERS=$(grep -c '^## ' docs/book/book.md || echo 0)
5959
echo "lines=$LINES" >> $GITHUB_OUTPUT
6060
echo "images=$IMAGES" >> $GITHUB_OUTPUT
6161
echo "tables=$TABLES" >> $GITHUB_OUTPUT
@@ -104,7 +104,7 @@ jobs:
104104
105105
- name: Clean source
106106
run: |
107-
sed -i 's/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]//g' book.md
107+
sed -i 's/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]//g' docs/book/book.md
108108
echo "Control characters cleaned"
109109
110110
- name: Extract metadata
@@ -114,9 +114,9 @@ jobs:
114114
echo "repo_name=$REPO_NAME" >> $GITHUB_OUTPUT
115115
echo "pdf_name=${REPO_NAME}-guide.pdf" >> $GITHUB_OUTPUT
116116
# Extract title from frontmatter or first heading
117-
TITLE=$(grep -m1 '^title:' book.md | sed 's/^title: *"*//;s/"*$//' || echo "")
117+
TITLE=$(grep -m1 '^title:' docs/book/book.md | sed 's/^title: *"*//;s/"*$//' || echo "")
118118
if [ -z "$TITLE" ]; then
119-
TITLE=$(head -10 book.md | grep "^# " | head -1 | sed 's/^# //')
119+
TITLE=$(head -10 docs/book/book.md | grep "^# " | head -1 | sed 's/^# //')
120120
fi
121121
if [ -z "$TITLE" ]; then TITLE="$REPO_NAME — Official Guide"; fi
122122
echo "title=$TITLE" >> $GITHUB_OUTPUT

.github/workflows/ci.yml

Lines changed: 54 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,54 @@
1-
name: ebuild CI
2-
3-
on:
4-
push:
5-
branches: [master, main]
6-
pull_request:
7-
branches: [master, main]
8-
9-
jobs:
10-
test:
11-
name: Python Tests
12-
runs-on: ubuntu-latest
13-
strategy:
14-
matrix:
15-
python-version: ["3.10", "3.11", "3.12"]
16-
steps:
17-
- uses: actions/checkout@v4
18-
19-
- name: Set up Python ${{ matrix.python-version }}
20-
uses: actions/setup-python@v5
21-
with:
22-
python-version: ${{ matrix.python-version }}
23-
24-
- name: Install
25-
run: pip install -e . 2>/dev/null || pip install -e ".[dev]" 2>/dev/null || true
26-
27-
- name: Install test tools
28-
run: pip install pytest flake8
29-
30-
- name: Lint
31-
run: flake8 ebuild/ --max-line-length=120 --ignore=E501,W503,E402 || true
32-
33-
- name: Run tests
34-
run: pytest tests/ -v --tb=short 2>/dev/null || echo "No pytest tests yet"
35-
36-
- name: CLI smoke test
37-
run: |
38-
python -m ebuild --version
39-
python -m ebuild list-packages 2>/dev/null || echo "OK (no build.yaml)"
1+
name: ebuild CI
2+
3+
on:
4+
push:
5+
branches: [master, main]
6+
pull_request:
7+
branches: [master, main]
8+
9+
permissions:
10+
contents: read
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
test:
18+
name: Python Tests (${{ matrix.os }} / ${{ matrix.python-version }})
19+
runs-on: ${{ matrix.os }}
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
os: [ubuntu-latest, windows-latest, macos-latest]
24+
python-version: ["3.10", "3.11", "3.12"]
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- name: Set up Python ${{ matrix.python-version }}
29+
uses: actions/setup-python@v5
30+
with:
31+
python-version: ${{ matrix.python-version }}
32+
33+
- name: Install
34+
shell: bash
35+
run: |
36+
set -e
37+
pip install -e ".[dev]" || pip install -e .
38+
39+
- name: Install test tools
40+
run: pip install pytest flake8
41+
42+
- name: Lint
43+
shell: bash
44+
run: flake8 ebuild/ --max-line-length=120 --ignore=E501,W503,E402
45+
46+
- name: Run tests
47+
shell: bash
48+
run: pytest tests/ -v --tb=short
49+
50+
- name: CLI smoke test
51+
shell: bash
52+
run: |
53+
python -m ebuild --version
54+
python -m ebuild list-packages

.github/workflows/eosim-sanity.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ on:
88
env:
99
EOSIM_VERSION: "0.1.0"
1010

11+
permissions:
12+
contents: read
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: false
17+
1118
jobs:
1219
install-validate:
1320
name: Install & Validate (${{ matrix.os }}, Python ${{ matrix.python-version }})

.github/workflows/nightly.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ on:
55
- cron: "0 3 * * *" # 3 AM UTC daily
66
workflow_dispatch:
77

8+
permissions:
9+
contents: read
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: false
14+
815
jobs:
916
full-test-suite:
1017
name: Full Test Suite

0 commit comments

Comments
 (0)