Skip to content

Commit c364bcc

Browse files
committed
chore: avoid required tty for github action test
The -it setting in docker run for the latex command fails. Replace teh latex run with the -i option instead.
1 parent d104acf commit c364bcc

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

.github/workflows/push.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ jobs:
8787
with:
8888
image: doubtfire-api-development:local
8989
options: >
90-
-it
90+
-t
9191
-v ${{ github.workspace }}:/doubtfire
9292
-v /var/run/docker.sock:/var/run/docker.sock
93-
run: docker exec -it ${{ env.LATEX_CONTAINER_NAME }} lualatex -v
93+
run: docker exec -t ${{ env.LATEX_CONTAINER_NAME }} lualatex -v
9494
- name: Populate database
9595
uses: addnab/docker-run-action@v3
9696
with:
@@ -124,10 +124,10 @@ jobs:
124124
with:
125125
image: doubtfire-api-development:local
126126
options: >
127-
-it
128127
-v ${{ github.workspace }}:/doubtfire
129128
-v ${{ github.workspace }}/student-work:/student-work
130129
-v /var/run/docker.sock:/var/run/docker.sock
130+
-v ${{ github.workspace }}/lib/shell/latex_run_notty.sh:/doubtfire/lib/shell/latex_run.sh
131131
-e RAILS_ENV
132132
-e DF_STUDENT_WORK_DIR
133133
-e DF_INSTITUTION_HOST

lib/shell/latex_build.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,17 @@ cd work
1313

1414
# Compile PDF
1515
lualatex -shell-escape -interaction=batchmode -halt-on-error input.tex
16-
echo "Running lualatex a second time to remove temporary last page..."
17-
lualatex -shell-escape -interaction=batchmode -halt-on-error input.tex
16+
RESULT=$?
17+
if [ $RESULT -eq 0 ]; then
18+
echo "Running lualatex a second time to remove temporary last page..."
19+
lualatex -shell-escape -interaction=batchmode -halt-on-error input.tex
20+
RESULT=$?
21+
fi
1822

1923
# Copy PDF to parent directory and cleanup
2024
cp *.log ../
2125
cp *.pdf ../
2226
cd ..
2327
rm -rf work
28+
29+
exit $RESULT

lib/shell/latex_run_notty.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
# This script is copied into tmp/rails-latex/$WORK_DIR/ and executed by rails-latex
3+
4+
WORK_DIR=$(basename "$PWD")
5+
docker exec -i $LATEX_CONTAINER_NAME ${LATEX_BUILD_PATH:-/texlive/shell/latex_build.sh} $WORK_DIR

0 commit comments

Comments
 (0)