Skip to content

Commit

Permalink
ci: working on CI (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdhughes-usgs authored Jan 8, 2022
1 parent 21eb965 commit dca54d5
Show file tree
Hide file tree
Showing 152 changed files with 2,923 additions and 490 deletions.
72 changes: 0 additions & 72 deletions .github/ci.yml

This file was deleted.

90 changes: 90 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: USGS LaTeX

on:
# schedule:
# - cron: '0 2 * * *' # run at 2 AM UTC
push:
branches:
- main
- develop
pull_request:
branches:
- develop

jobs:

usgsLaTeX_CI:
name: USGS LaTeX installation
runs-on: ubuntu-latest
strategy:
fail-fast: false
defaults:
run:
shell: bash

steps:
- name: Checkout this github repo
uses: actions/checkout@v2.3.4

- name: Install TeX Live
run: |
sudo apt install texlive-latex-extra texlive-science
- name: Install USGS LaTeX style files and Univers font
working-directory: ./usgsLaTeX
run: |
sudo ./install.sh --all-users
- name: List files in local latex directory
run: |
sudo ls -la /usr/local/share/texmf/tex/latex/usgs/
sudo ls -la /usr/local/share/texmf/tex/latex/usgs/visid_graphics/
- name: List files in local fonts directory
run: |
sudo ls -la /usr/local/share/texmf/fonts/
sudo ls -la /usr/local/share/texmf/fonts/afm/
sudo ls -la /usr/local/share/texmf/fonts/tfm/
sudo ls -la /usr/local/share/texmf/fonts/type1/
sudo ls -la /usr/local/share/texmf/fonts/vf/
- name: Build test LaTeX document
shell: python
run: |
import os
import sys
import subprocess
ws = "./test/"
for bibnam in ("USGSLaTeXReport", "testunivers",):
texnam = bibnam + ".tex"
cmds = [
["pdflatex", texnam],
["bibtex", bibnam],
["pdflatex", texnam],
["pdflatex", texnam],
]
for cmd in cmds:
print("running command...'{}'".format(" ".join(cmd)))
with subprocess.Popen(cmd,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
cwd=ws) as process:
stdout, stderr = process.communicate(timeout=10)
if stdout:
stdout = stdout.decode()
print(stdout)
if stderr:
print("\n\nError condition occurred:\n")
stderr = stderr.decode()
print(stderr)
file_name = os.path.join(ws, f"{bibnam}.pdf")
assert os.path.isfile(file_name), f"{file_name}...does not exist"
- name: Upload Build Artifacts
uses: actions/upload-artifact@v2
with:
name: test
path: |
./test/USGSLaTeXReport.pdf
./test/testunivers.pdf
Loading

0 comments on commit dca54d5

Please sign in to comment.