From b6a889e683a1a4aaccb324de4d291bfa559be251 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 21 Nov 2021 01:06:24 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20Try=20improving=20the=20sphinx?= =?UTF-8?q?=20actions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-sphinx-report.yml | 33 +++++++++++++++++++---- .github/workflows/build-sphinx-thesis.yml | 33 +++++++++++++++++++---- 2 files changed, 56 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-sphinx-report.yml b/.github/workflows/build-sphinx-report.yml index adf3924..6f7f375 100644 --- a/.github/workflows/build-sphinx-report.yml +++ b/.github/workflows/build-sphinx-report.yml @@ -3,14 +3,34 @@ on: push: branches: [ main ] paths: + - ".github/workflows/build-sphinx-report.yml" - "report/**" jobs: - html: - name: "Build HTML document" + setup: + name: "Setup the environment" runs-on: ubuntu-latest steps: - name: "Checkout repository" uses: actions/checkout@v2 + - name: "Setup Python" + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: "Setup Poetry" + uses: abatilo/actions-poetry@v2.0.0 + with: + poetry-version: 1.1.11 + - name: "Install backend dependencies" + working-directory: backend/ + run: "poetry install --no-interaction" + html: + name: "Build HTML document" + needs: [ setup ] + runs-on: ubuntu-latest + steps: + - name: "Activate Python environment" + run: | + source $(poetry env list --full-path | cut -f1 -d" ")/bin/activate - name: "Build HTML document with Sphinx" uses: ammaraskar/sphinx-action@master with: @@ -25,15 +45,18 @@ jobs: path: "report/_build/report.html.tar.gz" latexpdf: name: "Build PDF document" + needs: [ setup ] runs-on: ubuntu-latest steps: - - name: "Checkout repository" - uses: actions/checkout@v2 + - name: "Activate Python environment" + run: | + source $(poetry env list --full-path | cut -f1 -d" ")/bin/activate + - name: "Install Latex dependencies" + 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" uses: ammaraskar/sphinx-action@master with: docs-folder: "report/" - pre-build-command: "apt-get update -y && apt-get install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended" build-command: "make latexpdf" - name: "Upload build artifact" uses: actions/upload-artifact@v2 diff --git a/.github/workflows/build-sphinx-thesis.yml b/.github/workflows/build-sphinx-thesis.yml index c307019..ae0f15e 100644 --- a/.github/workflows/build-sphinx-thesis.yml +++ b/.github/workflows/build-sphinx-thesis.yml @@ -3,14 +3,34 @@ on: push: branches: [ main ] paths: + - ".github/workflows/build-sphinx-thesis.yml" - "thesis/**" jobs: - html: - name: "Build HTML document" + setup: + name: "Setup the environment" runs-on: ubuntu-latest steps: - name: "Checkout repository" uses: actions/checkout@v2 + - name: "Setup Python" + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: "Setup Poetry" + uses: abatilo/actions-poetry@v2.0.0 + with: + poetry-version: 1.1.11 + - name: "Install backend dependencies" + working-directory: backend/ + run: "poetry install --no-interaction" + html: + name: "Build HTML document" + needs: [ setup ] + runs-on: ubuntu-latest + steps: + - name: "Activate Python environment" + run: | + source $(poetry env list --full-path | cut -f1 -d" ")/bin/activate - name: "Build HTML document with Sphinx" uses: ammaraskar/sphinx-action@master with: @@ -25,15 +45,18 @@ jobs: path: "thesis/_build/thesis.html.tar.gz" latexpdf: name: "Build PDF document" + needs: [ setup ] runs-on: ubuntu-latest steps: - - name: "Checkout repository" - uses: actions/checkout@v2 + - name: "Activate Python environment" + run: | + source $(poetry env list --full-path | cut -f1 -d" ")/bin/activate + - name: "Install Latex dependencies" + 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" uses: ammaraskar/sphinx-action@master with: docs-folder: "thesis/" - pre-build-command: "apt-get update -y && apt-get install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended" build-command: "make latexpdf" - name: "Upload build artifact" uses: actions/upload-artifact@v2