Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
latextemplates
GitHub Repository: latextemplates/LNCS
Path: blob/main/check.yml
367 views
1
name: Check
2
on:
3
push:
4
branches:
5
- main
6
pull_request:
7
schedule:
8
- cron: "5 6 * * 1"
9
workflow_dispatch:
10
concurrency:
11
group: "${{ github.workflow }}-${{ github.head_ref || github.ref }}"
12
cancel-in-progress: true
13
jobs:
14
pdf:
15
name: pdf (latexmk paper)
16
runs-on: ubuntu-latest
17
steps:
18
- name: Set up Git repository
19
uses: actions/checkout@v5
20
- name: Install TeX Live
21
uses: zauguin/install-texlive@v4
22
with:
23
package_file: '${{ github.workspace }}/Texlivefile'
24
texlive_version: 2025
25
- name: Prepare latexmk
26
run: |
27
updmap -sys
28
texhash
29
tlmgr generate language --rebuild-sys
30
if [ ! -f "latexmkrc" ]; then
31
cp "_latexmkrc" "latexmkrc"
32
fi
33
- run: latexmk paper
34
35
# Highlight mis-spelled words in the PDF
36
- uses: awalsh128/cache-apt-pkgs-action@latest
37
with:
38
packages: aspell aspell-en aspell-de
39
version: 1.0
40
execute_install_scripts: true
41
- name: post-setup aspell
42
# refs https://github.com/awalsh128/cache-apt-pkgs-action/issues/157
43
run: |
44
sudo apt-get install -y aspell-en aspell-de
45
- name: aspell
46
run: |
47
for tex in $(ls *.tex content/*.tex 2>/dev/null); do
48
if [[ "en" == "de" && "$tex" == thesis-example* ]]; then
49
continue
50
fi
51
52
# The lualatex package "spelling" requires the content to be in a file ending with ".spell.bad"
53
aspell --mode=tex\
54
-l en_US\
55
--encoding=utf-8\
56
--conf=./.aspell.conf\
57
-p ./.aspell.en.pws list\
58
< $tex | sort | uniq >> paper.spell.bad
59
done
60
- run: latexmk paper
61
62
- name: Job summary using texlogsieve
63
run: |
64
texlogsieve --version | head -n 1
65
66
echo '```' >> $GITHUB_STEP_SUMMARY
67
texlogsieve paper.log | tee -a "$GITHUB_STEP_SUMMARY" || true
68
echo '```' >> $GITHUB_STEP_SUMMARY
69
- uses: actions/upload-artifact@v5
70
with:
71
name: test-result
72
path: |
73
paper.pdf
74
paper.log
75
paper.fls
76
word-count:
77
runs-on: ubuntu-latest
78
steps:
79
- name: Set up Git repository
80
uses: actions/checkout@v5
81
- name: Install TeX Live
82
uses: zauguin/install-texlive@v5
83
with:
84
package_file: '${{ github.workspace }}/Texlivefile'
85
texlive_version: 2025
86
- name: Count words
87
run: |
88
texcount -utf8 -inc paper.tex > texcount.txt
89
echo "## TeXcount word count" >> $GITHUB_STEP_SUMMARY
90
echo "" >> $GITHUB_STEP_SUMMARY
91
cat "texcount.txt" >> $GITHUB_STEP_SUMMARY
92
93
texcount -utf8 -inc -v -html paper.tex > texcount.html
94
95
# output for summary
96
# too verbose - therefore disabled
97
#
98
# texcount -utf8 -inc -v -htmlcore paper.tex > texcount.html-body
99
# echo "" >> $GITHUB_STEP_SUMMARY
100
# echo "## TeXcount LaTeX interpretation" >> $GITHUB_STEP_SUMMARY
101
# echo "" >> $GITHUB_STEP_SUMMARY
102
# cat "texcount.html-body" >> $GITHUB_STEP_SUMMARY
103
- uses: actions/upload-artifact@v4
104
with:
105
name: word-count
106
path: |
107
texcount.txt
108
texcount.html
109
spell-check:
110
# This is based on https://github.com/mh61503891/action-paper-aspell/tree/master
111
#
112
runs-on: ubuntu-latest
113
steps:
114
- name: Set up Git repository
115
uses: actions/checkout@v5
116
117
# Original action does not work well - see https://github.com/awalsh128/cache-apt-pkgs-action/pull/136
118
# The action is not updated - and thus the dictionaries are not updated
119
- uses: awalsh128/cache-apt-pkgs-action@latest
120
with:
121
packages: aspell aspell-en aspell-de
122
version: 1.0
123
execute_install_scripts: true
124
- name: post-setup aspell
125
# refs https://github.com/awalsh128/cache-apt-pkgs-action/issues/157
126
run: |
127
sudo apt-get install -y aspell-en aspell-de
128
- name: aspell
129
run: |
130
echo "| file | status |" >> $GITHUB_STEP_SUMMARY
131
echo "| -- | -- |" >> $GITHUB_STEP_SUMMARY
132
failure=0
133
for tex in $(ls *.tex content/*.tex 2>/dev/null); do
134
if [[ "en" == "de" && "$tex" == thesis-example* ]]; then
135
echo "$tex skipped"
136
continue
137
fi
138
echo "Checking $tex..."
139
140
# Words are output in the order they appear in the document
141
words=$(aspell --mode=tex -l en_US --encoding=utf-8 --conf=./.aspell.conf -p ./.aspell.en.pws list < $tex | tr '\n' ' ')
142
if [ -z "$words" ]; then
143
echo "| $tex | ✅ |" >> $GITHUB_STEP_SUMMARY
144
else
145
echo "| $tex | ❌ $words |" >> $GITHUB_STEP_SUMMARY
146
if [[ "$tex" == "paper.tex" ]]; then
147
failure=1
148
fi
149
fi
150
done
151
if [[ "$failure" -eq 1 ]]; then
152
echo "" >> $GITHUB_STEP_SUMMARY
153
echo 'If you want to ignore words, add them to `.aspell.en.pws` (your personal aspell dictionary)' >> $GITHUB_STEP_SUMMARY
154
exit 1
155
fi
156
indent:
157
runs-on: ubuntu-latest
158
steps:
159
- name: Set up Git repository
160
uses: actions/checkout@v5
161
- uses: awalsh128/cache-apt-pkgs-action@latest
162
with:
163
packages: libyaml-tiny-perl libfile-homedir-perl
164
version: 1.0
165
execute_install_scripts: true
166
- name: Install latexindent
167
uses: zauguin/install-texlive@v5
168
with:
169
packages: latexindent
170
texlive_version: 2025
171
- run: make format
172
- name: No changes made by latexindent
173
run: git diff --exit-code
174
175