You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e18bcc8
Browse filesBrowse the repository at this point in the historyBrowse files
Nedas
committed
Merge remote-tracking branch 'origin/main' into feature/switching-to-translated
# Optional repository secret: a direct download URL for the Linux x64
55
+
# Tabular Editor CLI archive (te-linux-x64.tar.gz). The CLI is gated
56
+
# behind sign-in, so there is no public URL to fetch it from. When the
57
+
# secret is unset, only the te-free annotation validation runs.
58
+
TE_CLI_URL: ${{ secrets.TE_CLI_DOWNLOAD_URL }}
59
+
steps:
60
+
- uses: actions/checkout@v4
61
+
- name: Set up Python
62
+
uses: actions/setup-python@v5
63
+
with:
64
+
python-version: '3.11'
65
+
- name: Validate doctest annotations
66
+
# Grammar and coverage of the ```csharp {compile} / {run ...} fences
67
+
# in every annotated content/*.md; no te needed.
68
+
run: ./run doctest validate
69
+
- name: Install Tabular Editor CLI
70
+
if: env.TE_CLI_URL != ''
71
+
run: |
72
+
mkdir -p "$RUNNER_TEMP/te"
73
+
curl -sSfL "$TE_CLI_URL" | tar -xz -C "$RUNNER_TEMP/te"
74
+
chmod +x "$RUNNER_TEMP/te/te"
75
+
echo "$RUNNER_TEMP/te" >> "$GITHUB_PATH"
76
+
"$RUNNER_TEMP/te/te" --version
77
+
- name: Run doctests
78
+
if: env.TE_CLI_URL != ''
79
+
# Compile and execute every annotated block against a throwaway model
80
+
# and diff its Output() against the documented **Output** fence.
81
+
run: ./run doctest
82
+
- name: Doctest execution skipped
83
+
if: env.TE_CLI_URL == ''
84
+
run: echo "::notice title=Doctests not executed::Set the TE_CLI_DOWNLOAD_URL repository secret to a te-linux-x64.tar.gz download URL to compile and run the annotated C# blocks in CI. Only annotation validation ran."
Copy file name to clipboardExpand all lines: README.md
+33Lines changed: 33 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,6 +69,7 @@ swa start _site
69
69
|`--skip-api`| Reuse existing API metadata in content/api, ~30-40% faster (local markdown iteration only, requires `--serve`/`--lang`; never for testing/CI/CD/releases) |
70
70
|`--permissive`| Don't treat English DocFX warnings as build failures (for local iteration; full/CI builds stay strict) |
71
71
|`--sync`| Copy English over missing/outdated translations for a local build. Fallback copies only: never commit them. The translation status file is not touched |
72
+
|`--warnings-report PATH`| Write a markdown summary of the DocFX warnings per built language to `PATH` (CI appends it to the job summary); written even when the build fails |
72
73
73
74
## What the Build Script Does
74
75
@@ -84,6 +85,38 @@ swa start _site
84
85
10.**Generates SWA config** - Creates `staticwebapp.config.json` for Azure Static Web Apps routing
85
86
11.**Generates the sitemap index** - Runs `gen_sitemap_index.py` last, once every per-language sitemap exists, to write the site-wide sitemap index and `robots.txt`
86
87
88
+
# Continuous integration
89
+
90
+
Every pull request against `main` (and every push to `main`) runs the workflow in [`.github/workflows/deploy.yml`](.github/workflows/deploy.yml).
91
+
The deploy step waits for all checks, so a failing check blocks both the production deploy and the PR preview site.
92
+
93
+
| Job | What it runs | Fails when |
94
+
|-----|--------------|------------|
95
+
| Lint build scripts |`./run scripts check`: ruff, ruff format, mypy `--strict` on the qualified Python sources (see `pyproject.toml`); shellcheck and shfmt on `run` and `build_scripts/run_scripts/*.sh`| any lint, type, or formatting finding |
96
+
| Doctest C# code blocks |`./run doctest validate` always; `./run doctest` (compile, run, and compare `**Output**` blocks) when a te CLI is available, see below | malformed annotation; with te: compile error, runtime error, or output mismatch |
97
+
| Build Documentation |`python build-docs.py --all --skip-gen --warnings-report build-warnings.md` on Windows, uploads `_site`; the per-language DocFX warning report goes to the job summary | DocFX build failure or English DocFX warnings |
98
+
| Check links |`python build_scripts/check_links.py validate stats` against the built `_site`| any broken **internal** link: missing file, missing anchor, or an old root-style path that no longer redirects on the live site |
99
+
| Deploy to Azure | Azure Static Web Apps upload | only after all of the above pass |
100
+
101
+
**External links are warnings only.**
102
+
The link check fetches every unique external URL once, but a bad status or a network error on a third-party site never fails the run:
103
+
the site is outside our control, and outages, bot-blocking, and link rot should not stop docs from shipping.
104
+
The full report, including the list of external URLs to verify by hand, is attached to the job summary of the "Check links" job.
105
+
Fix or remove genuinely dead external links as part of normal maintenance.
106
+
107
+
**Translation build warnings are visible but not blocking.**
108
+
Only English DocFX warnings fail the build; the es and zh builds are Crowdin-managed translations and may carry warnings such as broken bookmarks or missing includes.
109
+
The "Build Documentation" job summary lists every DocFX warning per language, so translation problems can be spotted and fed back without blocking a deploy.
110
+
111
+
**Executing the doctests needs the te CLI.**
112
+
The CLI download is gated behind sign-in, so the workflow cannot fetch it from a public URL.
113
+
Set the repository secret `TE_CLI_DOWNLOAD_URL` to a direct download URL for `te-linux-x64.tar.gz` (for example a private blob with a SAS token);
114
+
the doctest job then installs it and runs the full `./run doctest`.
115
+
Without the secret, the job validates the annotations only and posts a notice.
116
+
Use a te build aligned with the current Tabular Editor 3 release, otherwise the compare step reports false drift.
117
+
118
+
Run the same checks locally before pushing: `./run scripts check`, `./run doctest`, and `./run build` followed by `./run check-links`.
parser.add_argument("--skip-api", action="store_true", help="LOCAL markdown iteration only (requires --serve/--lang): reuse existing content/api, ~30-40%% faster. NEVER for testing/CI/CD/releases")
355
434
parser.add_argument("--permissive", action="store_true", help="Don't treat English DocFX warnings as build failures (for local iteration; keep full/CI builds strict)")
356
435
parser.add_argument("--sync", action="store_true", help="Copy English over missing/outdated translations for a local build (fallback copies only; never commit them)")
357
-
436
+
parser.add_argument("--warnings-report", metavar="PATH", help="Write a markdown summary of DocFX warnings per built language to PATH (for CI job summaries); written even when the build fails")
437
+
358
438
args=parser.parse_args()
359
-
439
+
440
+
try:
441
+
return_build(args)
442
+
finally:
443
+
# Written even after a failed language build, so CI still gets the partial picture.
444
+
ifargs.warnings_report:
445
+
write_warnings_report(Path(args.warnings_report))
446
+
447
+
448
+
def_build(args: argparse.Namespace) ->int:
449
+
"""Run the build described by the parsed command line; returns the exit code."""
Copy file name to clipboardExpand all lines: build_scripts/README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,7 @@ Both need `te` on PATH.
44
44
45
45
Current state only validates semantic bridge docs.
46
46
The code block annotations can be used in any doc.
47
+
CI runs `./run doctest validate` on every PR, and the full `./run doctest` when the `TE_CLI_DOWNLOAD_URL` repository secret provides a te CLI; see [Continuous integration](../README.md#continuous-integration).
47
48
48
49
#### `te_script_runner.py` -- generic runner
49
50
@@ -183,6 +184,7 @@ Fragment/text failures keep their `#anchor` / `:~:text=` in that list (the bare
183
184
the fragment is what broke); a wholly unreachable URL is listed bare.
184
185
185
186
Exit codes: `1` if any internal (own-site) reference is broken, else `0`. External warnings never fail the run, so third-party link rot will not break CI.
187
+
CI runs `validate stats` against the built site on every PR and attaches the report to the job summary; see [Continuous integration](../README.md#continuous-integration).
0 commit comments