From f26a2533e8783bdf535e1bfeb5072b90268ef80c Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 21 Nov 2021 05:22:41 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20Try=20to=20activate=20the=20poet?= =?UTF-8?q?ry=20venv=20before=20running=20make?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-sphinx-report.yml | 8 ++++++-- .github/workflows/build-sphinx-thesis.yml | 8 ++++++-- thesis/Makefile | 19 +++++++------------ 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build-sphinx-report.yml b/.github/workflows/build-sphinx-report.yml index b7258f6..202fb6f 100644 --- a/.github/workflows/build-sphinx-report.yml +++ b/.github/workflows/build-sphinx-report.yml @@ -29,7 +29,9 @@ jobs: run: echo "pythonLocation=$(poetry env list --full-path | cut -f1 -d' ')/bin" >> $GITHUB_ENV - name: "Build HTML document with Sphinx" working-directory: report/ - run: make html + run: | + source $pythonLocation/activate + make html - name: "Create a gzip of the build" run: "tar -xvzf report/_build/report.html.tar.gz report/_build/html" - name: "Upload build artifact" @@ -61,7 +63,9 @@ jobs: run: apt-get update -y && apt-get install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended - name: "Build Latex document with Sphinx" working-directory: report/ - run: make latexpdf + run: | + source $pythonLocation/activate + make latexpdf - name: "Upload build artifact" uses: actions/upload-artifact@v2 with: diff --git a/.github/workflows/build-sphinx-thesis.yml b/.github/workflows/build-sphinx-thesis.yml index ddfb785..91d27fb 100644 --- a/.github/workflows/build-sphinx-thesis.yml +++ b/.github/workflows/build-sphinx-thesis.yml @@ -29,7 +29,9 @@ jobs: run: echo "pythonLocation=$(poetry env list --full-path | cut -f1 -d' ')/bin" >> $GITHUB_ENV - name: "Build HTML document with Sphinx" working-directory: thesis/ - run: make html + run: | + source $pythonLocation/activate + make html - name: "Create a gzip of the build" run: "tar -xvzf thesis/_build/thesis.html.tar.gz thesis/_build/html" - name: "Upload build artifact" @@ -61,7 +63,9 @@ jobs: run: apt-get update -y && apt-get install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended - name: "Build Latex document with Sphinx" working-directory: thesis/ - run: make latexpdf + run: | + source $pythonLocation/activate + make latexpdf - name: "Upload build artifact" uses: actions/upload-artifact@v2 with: diff --git a/thesis/Makefile b/thesis/Makefile index b343f0b..86bf5be 100644 --- a/thesis/Makefile +++ b/thesis/Makefile @@ -1,23 +1,18 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line, and also -# from the environment for the first two. -SPHINXOPTS ?= -SPHINXBUILD ?= "sphinx-build" -SOURCEDIR = "source" -BUILDDIR = "build" +export SPHINXOPTS = +export SPHINXBUILD = "sphinx-build" +export SOURCEDIR = "source" +export BUILDDIR = "build" export LATEXMKOPTS ?= "" export LATEXOPTS ?= "-interaction=nonstopmode" # Put it first so that "make" without argument is like "make help". help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) livehtml: - sphinx-autobuild "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + sphinx-autobuild "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) .PHONY: help Makefile @@ -25,4 +20,4 @@ livehtml: # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS)