Pārlūkot izejas kodu

Unbreak readthedocs build (#1304)

Signed-off-by: Sean Young <sean@mess.org>
Sean Young 2 gadi atpakaļ
vecāks
revīzija
b961ce1d26
4 mainītis faili ar 39 papildinājumiem un 9 dzēšanām
  1. 14 8
      .github/workflows/test.yml
  2. 23 0
      .readthedocs.yaml
  3. 2 1
      docs/conf.py
  4. 0 0
      docs/requirements.txt

+ 14 - 8
.github/workflows/test.yml

@@ -43,18 +43,24 @@ jobs:
     runs-on: solang-ubuntu-latest
     container: ubuntu:22.04
     steps:
-      - name: Checkout sources
-        uses: actions/checkout@v3
       - name: Install Python and git
         run: |
           apt-get update
-          apt-get install -y python3-pip git pkg-config libcairo-dev
-      - name: Install Docs requirements.txt
-        run : |
-          pip install -r requirements.txt
+          apt-get install -y python3-pip git pkg-config libcairo-dev latexmk
+      - name: Checkout sources
+        uses: actions/checkout@v3.1.0
+        with:
+          # docs/conf.py uses `git describe --tags` which requires full history
+          fetch-depth: 0
       - name: Build docs
-        run: make html
-        working-directory: docs
+        working-directory: ./docs
+        run: |
+          # Without the --add safe.directory we get the following error:
+          # fatal: detected dubious ownership in repository at '/__w/solang/solang'
+          # actions/checkout@v3.1.0 is supposed to fix this, but it does not work
+          git config --global --add safe.directory "${GITHUB_WORKSPACE}"
+          pip install -r requirements.txt
+          make html epub
 
   linux-x86-64:
     name: Linux x86-64

+ 23 - 0
.readthedocs.yaml

@@ -0,0 +1,23 @@
+# Read the Docs configuration file
+
+# Required
+version: 2
+
+# Optionally build your docs in additional formats such as PDF
+formats:
+ - pdf
+ - epub
+
+build:
+  os: ubuntu-22.04
+  tools:
+    python: "3.11"
+
+sphinx:
+  builder: html
+  configuration: docs/conf.py
+
+# Explicitly set the version of Python and its requirements
+python:
+  install:
+    - requirements: docs/requirements.txt

+ 2 - 1
docs/conf.py

@@ -26,10 +26,11 @@ def setup(sphinx):
 # -- Project information -----------------------------------------------------
 
 project = 'Solang Solidity Compiler'
-copyright = '2019 - 2022 Solang Maintainers'
+copyright = '2019 - 2023 Solang Maintainers'
 author = 'Sean Young <sean@mess.org>, Cyrill Leutwiler <bigcyrill@hotmail.com>, Lucas Steuernagel <lucas.tnagel@gmail.com>'
 
 # The full version, including alpha/beta/rc tags
+version = os.popen('git describe --tags --abbrev=0').readline().strip()
 release = os.popen('git describe --tags').readline().strip()
 
 # -- General configuration ---------------------------------------------------

+ 0 - 0
requirements.txt → docs/requirements.txt