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