ammaraskar / sphinx-action

Github action that builds docs using sphinx and places errors inline
Apache License 2.0
194 stars 116 forks source link

Problems with the Sphinx Workflow #46

Closed ghost closed 2 years ago

ghost commented 2 years ago

I am writing a Python package. The code documentation should be realized via a workflow on a Github page. I have the following folder structure:

D:.
│   .gitignore
│   .pylintrc
│   LICENSE
│   README.md
│   requirements.txt
│   setup.py
│
├───.github
│   └───workflows
│           pylint.yml
│           pypi.yml
│           sphinx.yml
│
├───docs
│       conf.py
│
└───riffecx
        __init__.py
        __main__.py

The Python source code works and even the linter works. All other workflows also run without problems.

Here is my Sphinx workflow as sphinx.yml

name: "Pull Request Docs Check"
on: 
- push

jobs:
  docs:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - name: make folder
      run: |
        mkdir /tmp/sphinx-log
    - uses: ammaraskar/sphinx-action@master
      with:
        docs-folder: "docs/"

The source code for the workflow is from the github action page. I have changed the __pull_request to a push__, because it should run again after each push. GitHub Sphinx Action

Here I put the error log of the workflow. Error:

make: *** No rule to make target 'html'.  Stop.
[sphinx-action] Starting sphinx-action build.
Running: 
====================================
Building docs in docs/
====================================
Traceback (most recent call last):
[sphinx-action] Running: ['make', 'html', '-e']
  File "/entrypoint.py", line 22, in <module>
    action.build_all_docs(github_env, [os.environ.get("INPUT_DOCS-FOLDER")])
  File "/sphinx_action/action.py", line 152, in build_all_docs
    return_code, annotations = build_docs(github_env.build_command, docs_dir)
  File "/sphinx_action/action.py", line 134, in build_docs
    with open(log_file, "r") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/sphinx-log'

Example: https://github.com/Riffecs/riffecx/runs/6498919334?check_suite_focus=true

Unfortunately, I have a complete error in thinking somewhere. So I thought that I get the sphinx files either as a branch or as an artifact and from there I can "upload" them to the github page. But obviously I think wrong there. can you help me there?

Thank you.

ghost commented 2 years ago

Hi. I don't think anything else will happen here. Therefore, I close the issue. Unfortunately, the problem could not be fixed.