Skip to content

Commit a022fb8

Browse files
NetdocsCopilot
andcommitted
ci: add action self-test that builds docs-site via the container action
Runs the composite action (uses: ./) against docs-site so the exact container pull + docker run path is exercised and observable in the public repo's CI logs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 927f75c commit a022fb8

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Action Self-Test
2+
3+
# Exercises the composite action end-to-end (container pull + docker run) against
4+
# the repo's own docs-site, so the exact path consumers hit is observable in CI.
5+
on:
6+
push:
7+
branches: [main]
8+
paths:
9+
- "action.yml"
10+
- ".github/workflows/action-selftest.yml"
11+
workflow_dispatch:
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
selftest:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Build docs-site via the Netdocs action
26+
uses: ./
27+
with:
28+
command: build
29+
config: docs-site/appsettings.json
30+
31+
- name: Verify output
32+
shell: bash
33+
run: |
34+
set -euo pipefail
35+
out="docs-site/site"
36+
if [ ! -d "${out}" ]; then
37+
echo "::error::Expected build output at ${out} was not produced." >&2
38+
exit 1
39+
fi
40+
count="$(find "${out}" -name '*.html' | wc -l)"
41+
echo "Generated ${count} HTML pages in ${out}."
42+
test "${count}" -gt 0

0 commit comments

Comments
 (0)