44 lines
921 B
YAML
44 lines
921 B
YAML
name: LaTeX Lint
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- dev
|
|
paths:
|
|
- 'latex/**/*.tex'
|
|
- 'latex/main.tex'
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install chktex
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y chktex
|
|
|
|
- name: Run chktex inside latex/
|
|
working-directory: latex
|
|
run: |
|
|
TEX_FILES=$(find . -type f -name "*.tex")
|
|
if [ -z "$TEX_FILES" ]; then
|
|
echo "No .tex files found in latex/. Skipping lint."
|
|
exit 0
|
|
fi
|
|
|
|
echo "Linting .tex files with chktex..."
|
|
FAIL=0
|
|
for f in $TEX_FILES; do
|
|
chktex -q -n1 "$f" || FAIL=1
|
|
done
|
|
|
|
if [ $FAIL -ne 0 ]; then
|
|
echo "::error::Lint errors detected."
|
|
exit 1
|
|
fi
|