Skip to content

Commit a26ecaf

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 482e23e commit a26ecaf

10 files changed

Lines changed: 226 additions & 69 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: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ concurrency:
1313
group: ${{ github.workflow }}-${{ github.ref }}
1414
cancel-in-progress: true
1515

16+
permissions:
17+
contents: read
18+
1619
jobs:
1720
test:
18-
name: Test (${{ matrix.os }})
21+
name: Test (${{ matrix.os }} / Go ${{ matrix.go-version }})
1922
runs-on: ${{ matrix.os }}
20-
continue-on-error: true
2123
strategy:
2224
fail-fast: false
2325
matrix:
@@ -28,6 +30,8 @@ jobs:
2830
- uses: actions/setup-go@v5
2931
with:
3032
go-version: ${{ matrix.go-version }}
33+
- name: go vet
34+
run: go vet ./...
3135
- name: Run tests
3236
run: go test -race -v -count=1 -coverprofile=coverage.out ./...
3337
- name: Upload coverage
@@ -40,7 +44,6 @@ jobs:
4044
lint:
4145
name: Lint
4246
runs-on: ubuntu-latest
43-
continue-on-error: true
4447
steps:
4548
- uses: actions/checkout@v4
4649
- uses: actions/setup-go@v5
@@ -50,26 +53,29 @@ jobs:
5053
uses: golangci/golangci-lint-action@v6
5154
with:
5255
version: latest
56+
- name: Install staticcheck
57+
run: go install honnef.co/go/tools/cmd/staticcheck@latest
58+
- name: Run staticcheck
59+
run: staticcheck ./...
5360

5461
fuzz:
5562
name: Fuzz Tests
5663
runs-on: ubuntu-latest
57-
continue-on-error: true
5864
steps:
5965
- uses: actions/checkout@v4
6066
- uses: actions/setup-go@v5
6167
with:
6268
go-version: "1.22"
6369
- name: Run fuzz tests
6470
run: |
71+
set -e
6572
for pkg in $(go list ./... | grep -E 'protocol|core|security'); do
66-
go test -fuzz=. -fuzztime=30s "$pkg" 2>/dev/null || true
73+
go test -fuzz=. -fuzztime=30s "$pkg" || true
6774
done
6875
6976
benchmark:
7077
name: Benchmarks
7178
runs-on: ubuntu-latest
72-
continue-on-error: true
7379
steps:
7480
- uses: actions/checkout@v4
7581
- uses: actions/setup-go@v5
@@ -85,19 +91,33 @@ jobs:
8591
build-c-sdk:
8692
name: C SDK (${{ matrix.os }})
8793
runs-on: ${{ matrix.os }}
88-
continue-on-error: true
8994
strategy:
9095
fail-fast: false
9196
matrix:
92-
os: [ubuntu-latest, macos-latest]
97+
os: [ubuntu-latest, macos-latest, windows-latest]
9398
steps:
9499
- uses: actions/checkout@v4
95-
- name: Build C SDK
100+
- name: Build C SDK (Unix)
101+
if: runner.os != 'Windows'
102+
shell: bash
96103
run: |
97104
cd sdk/c
98105
if [ -f CMakeLists.txt ]; then
99106
cmake -B build
100-
cmake --build build
107+
cmake --build build --parallel
101108
elif [ -f Makefile ]; then
102109
make
103-
fi
110+
else
111+
echo "::warning::No build system found in sdk/c"
112+
fi
113+
- name: Build C SDK (Windows)
114+
if: runner.os == 'Windows'
115+
shell: bash
116+
run: |
117+
cd sdk/c
118+
if [ -f CMakeLists.txt ]; then
119+
cmake -B build -A x64
120+
cmake --build build --config Release --parallel
121+
else
122+
echo "::warning::No CMakeLists.txt found in sdk/c on Windows"
123+
fi

‎.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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ concurrency:
99
group: ${{ github.workflow }}-${{ github.ref }}
1010
cancel-in-progress: false
1111

12+
permissions:
13+
contents: read
14+
1215
jobs:
1316
test:
1417
name: Test (${{ matrix.os }})

‎.github/workflows/qemu-test.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
simulate:
1320
name: EoSim ${{ matrix.platform }}

0 commit comments

Comments
 (0)