-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathcheck.yml
More file actions
173 lines (165 loc) · 5.75 KB
/
check.yml
File metadata and controls
173 lines (165 loc) · 5.75 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
name: Check
on:
push:
branches:
- main
pull_request:
schedule:
- cron: "5 6 * * 1"
workflow_dispatch:
concurrency:
group: "${{ github.workflow }}-${{ github.head_ref || github.ref }}"
cancel-in-progress: true
jobs:
pdf:
name: pdf (latexmk paper)
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v5
- name: Install TeX Live
uses: zauguin/install-texlive@v4
with:
package_file: '${{ github.workspace }}/Texlivefile'
texlive_version: 2025
- name: Prepare latexmk
run: |
updmap -sys
texhash
tlmgr generate language --rebuild-sys
if [ ! -f "latexmkrc" ]; then
cp "_latexmkrc" "latexmkrc"
fi
- run: latexmk paper
# Highlight mis-spelled words in the PDF
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: aspell aspell-en aspell-de
version: 1.0
execute_install_scripts: true
- name: post-setup aspell
# refs https://github.com/awalsh128/cache-apt-pkgs-action/issues/157
run: |
sudo apt-get install -y aspell-en aspell-de
- name: aspell
run: |
for tex in $(ls *.tex content/*.tex 2>/dev/null); do
if [[ "en" == "de" && "$tex" == thesis-example* ]]; then
continue
fi
# The lualatex package "spelling" requires the content to be in a file ending with ".spell.bad"
aspell --mode=tex\
-l en_US\
--encoding=utf-8\
--conf=./.aspell.conf\
-p ./.aspell.en.pws list\
< $tex | sort | uniq >> paper.spell.bad
done
- run: latexmk paper
- name: Job summary using texlogsieve
run: |
texlogsieve --version | head -n 1
echo '```' >> $GITHUB_STEP_SUMMARY
texlogsieve paper.log | tee -a "$GITHUB_STEP_SUMMARY" || true
echo '```' >> $GITHUB_STEP_SUMMARY
- uses: actions/upload-artifact@v5
with:
name: test-result
path: |
paper.pdf
paper.log
paper.fls
word-count:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v5
- name: Install TeX Live
uses: zauguin/install-texlive@v5
with:
package_file: '${{ github.workspace }}/Texlivefile'
texlive_version: 2025
- name: Count words
run: |
texcount -utf8 -inc paper.tex > texcount.txt
echo "## TeXcount word count" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
cat "texcount.txt" >> $GITHUB_STEP_SUMMARY
texcount -utf8 -inc -v -html paper.tex > texcount.html
# output for summary
# too verbose - therefore disabled
#
# texcount -utf8 -inc -v -htmlcore paper.tex > texcount.html-body
# echo "" >> $GITHUB_STEP_SUMMARY
# echo "## TeXcount LaTeX interpretation" >> $GITHUB_STEP_SUMMARY
# echo "" >> $GITHUB_STEP_SUMMARY
# cat "texcount.html-body" >> $GITHUB_STEP_SUMMARY
- uses: actions/upload-artifact@v4
with:
name: word-count
path: |
texcount.txt
texcount.html
spell-check:
# This is based on https://github.com/mh61503891/action-paper-aspell/tree/master
#
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v5
# Original action does not work well - see https://github.com/awalsh128/cache-apt-pkgs-action/pull/136
# The action is not updated - and thus the dictionaries are not updated
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: aspell aspell-en aspell-de
version: 1.0
execute_install_scripts: true
- name: post-setup aspell
# refs https://github.com/awalsh128/cache-apt-pkgs-action/issues/157
run: |
sudo apt-get install -y aspell-en aspell-de
- name: aspell
run: |
echo "| file | status |" >> $GITHUB_STEP_SUMMARY
echo "| -- | -- |" >> $GITHUB_STEP_SUMMARY
failure=0
for tex in $(ls *.tex content/*.tex 2>/dev/null); do
if [[ "en" == "de" && "$tex" == thesis-example* ]]; then
echo "$tex skipped"
continue
fi
echo "Checking $tex..."
# Words are output in the order they appear in the document
words=$(aspell --mode=tex -l en_US --encoding=utf-8 --conf=./.aspell.conf -p ./.aspell.en.pws list < $tex | tr '\n' ' ')
if [ -z "$words" ]; then
echo "| $tex | ✅ |" >> $GITHUB_STEP_SUMMARY
else
echo "| $tex | ❌ $words |" >> $GITHUB_STEP_SUMMARY
if [[ "$tex" == "paper.tex" ]]; then
failure=1
fi
fi
done
if [[ "$failure" -eq 1 ]]; then
echo "" >> $GITHUB_STEP_SUMMARY
echo 'If you want to ignore words, add them to `.aspell.en.pws` (your personal aspell dictionary)' >> $GITHUB_STEP_SUMMARY
exit 1
fi
indent:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v5
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libyaml-tiny-perl libfile-homedir-perl
version: 1.0
execute_install_scripts: true
- name: Install latexindent
uses: zauguin/install-texlive@v5
with:
packages: latexindent
texlive_version: 2025
- run: make format
- name: No changes made by latexindent
run: git diff --exit-code