Skip to content

Update GitHub Actions #7

Update GitHub Actions

Update GitHub Actions #7

Workflow file for this run

name: LaTeX Build and Lint
on:
push:
pull_request:
schedule:
# Schedule to run at 00:00 UTC on the 1st of every month
- cron: '0 0 1 * *'
jobs:
build-and-lint:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v2
- name: Install LaTeX
run: |
sudo apt-get update
sudo apt-get install -y texlive-latex-base texlive-fonts-recommended texlive-latex-extra texlive-fonts-extra texlive-latex-recommended texlive-science
- name: Install cpanminus and Perl dependencies
run: |
sudo apt-get update
sudo apt-get install -y cpanminus
sudo cpanm Log::Log4perl Log::Dispatch::File YAML::Tiny File::HomeDir Unicode::GCString
- name: Install latexindent
run: |
curl -L https://github.com/cmhughes/latexindent.pl/archive/master.zip -o latexindent.zip
unzip latexindent.zip -d latexindent
sudo cp -r latexindent/latexindent.pl-main/* /usr/local/bin/
sudo chmod +x /usr/local/bin/latexindent.pl
sudo mv /usr/local/bin/latexindent.pl /usr/local/bin/latexindent
- name: Verify latexindent installation
run: |
latexindent --version
- name: Check LaTeX formatting
working-directory: hw/latex
run: make check
- name: Compile LaTeX documents
working-directory: hw/latex
run: make all
- name: Find PDF files
working-directory: hw/latex
id: find_pdfs
run: |
echo "pdfs=$(ls hw/latex/*.pdf)" >> $GITHUB_OUTPUT
upload-pdfs:
needs: build-and-lint
runs-on: ubuntu-latest
strategy:
matrix:
pdf: ${{ fromJson(needs.build-and-lint.outputs.pdfs) }}
steps:
- name: Upload PDF
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.pdf }}
path: hw/latex/${{ matrix.pdf }}