Files
Kun Chen 8b01676fed docs: add documentation site and publishing workflow (#36)
* feat(docs): add documentation site

* no-mistakes(review): harden docs build and Astro version

* no-mistakes(review): harden docs Pages deployment workflow

* no-mistakes(review): align docs with canonical config keys

* no-mistakes(review): fix docs accuracy for config and platform notes

* no-mistakes(review): fix docs workflow and CI naming

* no-mistakes(review): Scope docs workflow concurrency group

* no-mistakes(document): Updated `README.md` to reflect the new documentation site introduced by this change and to document the new `make docs` and `make docs-preview` targets added to the Makefile.

* no-mistakes: apply babysit fixes
2026-04-13 00:47:52 -07:00

35 lines
903 B
Go

package main
import (
"os"
"strings"
"testing"
)
func TestDocsWorkflowUsesScopedConcurrencyGroup(t *testing.T) {
data, err := os.ReadFile(".github/workflows/docs.yml")
if err != nil {
t.Fatalf("read workflow: %v", err)
}
content := string(data)
if !strings.Contains(content, "group: pages-${{ github.event_name }}-${{ github.ref }}") {
t.Fatalf("docs workflow must scope concurrency by event and ref")
}
if strings.Contains(content, "group: pages\n") {
t.Fatalf("docs workflow must not use a global concurrency group")
}
}
func TestDocsWorkflowSkipsPagesSetupOnPullRequests(t *testing.T) {
data, err := os.ReadFile(".github/workflows/docs.yml")
if err != nil {
t.Fatalf("read workflow: %v", err)
}
content := string(data)
if !strings.Contains(content, "if: github.event_name != 'pull_request'") {
t.Fatalf("docs workflow must skip Pages-only setup on pull requests")
}
}