Skip to content

Commit 4ba1b6c

Browse files
committed
ci(check_toc_txt): add a lock to prevent regression
Add a CI workflow to lock this progress. Hopefully this will alert us of whenever any damaging changes are occurring to the toc files in the future. Signed-off-by: Randolph Sapp <rs@ti.com>
1 parent 9df049a commit 4ba1b6c

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

.github/workflows/check_toc_txt.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
name: "check_toc_txt"
3+
4+
on:
5+
pull_request:
6+
branches: [master]
7+
paths:
8+
- 'source/**'
9+
- 'configs/*/*_toc.txt'
10+
11+
defaults:
12+
run:
13+
shell: bash
14+
15+
jobs:
16+
lint:
17+
name: Lint
18+
runs-on: ubuntu-latest
19+
container:
20+
image: ghcr.io/texasinstruments/processor-sdk-doc:latest
21+
options: --entrypoint /bin/bash
22+
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
27+
- name: Update refs and settings
28+
run: |
29+
git config --global --add safe.directory "$PWD"
30+
git switch -C pr
31+
git fetch --no-tags --depth=1 origin master
32+
git switch master
33+
34+
- name: Run rstcheck
35+
run: |
36+
# Disable color output
37+
export NO_COLOR=true
38+
39+
# Run the test
40+
bin/delta.sh -a master -b pr -- ./bin/check_toc_txt.py
41+
42+
# Prepare summary
43+
WARNING_COUNT=$(wc -l < _new-warn.log)
44+
if [ "$WARNING_COUNT" -gt "0" ]; then
45+
echo "New issues found with check_toc_txt.py:"
46+
echo '```text'
47+
cat _new-warn.log
48+
echo '```'
49+
else
50+
echo "No new issues found with check_toc_txt.py"
51+
fi >> "$GITHUB_STEP_SUMMARY"
52+
53+
# Prepare the artifacts
54+
mkdir -p ./results
55+
echo "${{ github.event.number }}" > ./results/id
56+
cp "$GITHUB_STEP_SUMMARY" ./results/summary
57+
echo "$(wc -l < _new-warn.log)" > ./results/problem-count
58+
59+
# Exit with error if there are new warnings
60+
[ "$WARNING_COUNT" -eq "0" ]
61+
62+
- name: Save results
63+
uses: actions/upload-artifact@v4
64+
if: always()
65+
with:
66+
name: results
67+
path: results/
68+
retention-days: 1

.github/workflows/comment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
workflow_run:
66
workflows:
77
- rstcheck
8+
- check_toc_txt
89
types:
910
- completed
1011

0 commit comments

Comments
 (0)