GitHub Actions - Building docs

Hi,

I am building docs using GitHub actions.

It gets stuck while installing libraries.
Is there any workaround how to increase the memory? Or maybe someone had a similar issue?

Package local building and invoking docs works ok - Windows OS.

The repository:
Merge branch ‘main’ of https://github.com/petrasvestartas/compas_wood · petrasvestartas/compas_wood@afe727e

@Li_Chen could you have a look at this?

Also for this repo the building actions works without issue.
Just this docs memory issue appears.
Any advice would be much appreciated.
Is this error coming from the size of the docs or environment build?
(For sure the git push message is misleading :slight_smile: )

I am wondering why the docs actions needs to build the current environment. Since it is only documentation generation. Maybe I could pass the docs without boost, cgal, eigen and the other libs.

FIX COMPAS check the docs.yml update by updating the c++ libs · petrasvestartas/compas_wood@7d07df7 (github.com)

FIX COMPAS check the docs.yml update by updating the c++ libs · petrasvestartas/compas_wood@7d07df7 (github.com)

Hi @petrasvestartas , indeed, it’s really weird that build action was alright while docs failed. Using conda is likely still be necessary because when fetching the API references, all code has to be importable, unless you write import exception everywhere when there is a conda package. Not too long ago we have upgrade compas-actions.docs to v2, which use nested actions and should be a bit more efficient. Could you give that a try and see if it could pass? To do that you simply replace you .github/workflows/docs.yaml with this: compas_view2/docs.yml at main · compas-dev/compas_view2 · GitHub

Thank you. The error message changes.
The new .yml configuration from probably needs dependencies.

Following the errors below. The first test pass and it means that the repo is building correctly. But it does not find dependencies.

Since I think it misses third party dependencies where would you add those of the docs.yml file?
I am wondering if there is a way to specify not to run any code just invoke docs when docs.yml is used? I guess testing the files in the “tests” folder was made on purpose.

        run: |
          conda install eigen=3.4 boost-cpp mpir mpfr cgal-cpp=5.5 pybind11 compas -y
          pip install -r requirements-dev.txt
          invoke docs

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

=========================== short test summary info ===========================

ERROR tests/compas_wood_2_read_xml.py - ModuleNotFoundError: No module named ...

ERROR tests/compas_wood_3_joints.py - ModuleNotFoundError: No module named 'c...

ERROR tests/compas_wood_4_rtree.py - ModuleNotFoundError: No module named 'co...

ERROR tests/compas_wood_5_get_connection_zones.py -   File "D:\a\compas_wood\...

ERROR tests/compas_wood_6_closed_mesh_from_polylines.py - ModuleNotFoundError...

ERROR src/compas_wood/viewer_helpers.py - ModuleNotFoundError: No module name...

!!!!!!!!!!!!!!!!!!! Interrupted: 6 errors during collection !!!!!!!!!!!!!!!!!!!

======================= 5 warnings, 6 errors in 12.86s ========================


________________________________________________________________________

_______________________Hello from CPP Wood______________________________

___If you see this message, say hi to the developer Petras Vestartas ___

____________________petrasvestartas@gmail.com___________________________

________________________________________________________________________
Error: Process completed with exit code 2.

I think there was a grammar error you were having in the yml file. For conda dependencies you can add them in env_win.yml and env_osx.yml I just made a PR on your repo

Hi,

Thank you very much for helping with this issue.

I tried to add changes in docs.yml and add dependency of view2 in the other .yml files. Then pushed the commit which resulted in a non-ending docs action running.

I thought that I did something wrong. So I also tested your forked repository which also does not build the docs action. It too stops when 360 min limit is exceeded.

What am I missing? Or is it normal that the action is in continuous process (the pages are not updated) ?

I add the screenshots.

Your changes:

The current repo with changes with the same changes apllied resulting in the same behavior:

I see. I did some tests, seems the conda update command in docs v2 we use it having some issues causing a never ending dependency solving. Which I will need to spend some time fixing.

I tried to revert back to v1 for now, and adding the dependencies manually in the workflow file, it was finally able to build (only rejected in the end for publishing due to permission, which should not be the case when running on your original repo)

Could you give a try:

name: docs

on:
  push:
    branches:
      - main
    tags:
      - 'v*'
  pull_request:
    branches:
      - main

jobs:
  build:
    name: build and deploy docs
    runs-on: windows-latest
    defaults:
      run:
        shell: bash -l {0}
    steps:
      - uses: actions/checkout@v2

      - uses: conda-incubator/setup-miniconda@v2.0.0
        with:
          miniconda-version: "latest"
          activate-environment: wood
          channels: conda-forge
          python-version: 3.8

      - name: build (windows)
        run: |
          conda install mpir mpfr boost-cpp eigen=3.4 cgal-cpp=5.5 pybind11 compas compas_view2 -y
          pip install -r requirements-dev.txt
          invoke docs

      - uses: compas-dev/compas-actions.docs@v1.3.0
        id: docs
        with:
          dest: deploy
          build_to_subfolder: true
          install_dependencies: false
          build_docs: false

      - name: Deploy docs
        if: success() && steps.docs.outputs.commit_type != 'pull'
        uses: crazy-max/ghaction-github-pages@v2
        with:
          target_branch: gh-pages
          build_dir: deploy
          keep_history: true
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

    outputs:
      commit_type: ${{ steps.docs.outputs.commit_type }}
      current_version: ${{ steps.docs.outputs.current_version }}

  docVersions:
    needs: build
    if: needs.build.outputs.commit_type == 'tag'
    name: update doc versions
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          ref: gh-pages

      - uses: compas-dev/compas-actions.docversions@v1.3.0
        with:
          current_version: ${{ needs.build.outputs.current_version }}

      - name: Deploy docs
        if: success()
        uses: crazy-max/ghaction-github-pages@v2
        with:
          target_branch: gh-pages
          build_dir: ./
          keep_history: false
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 Like

Hooray builds correctly ! :man_dancing:
Thank you :slight_smile:

How do you normally debug github actions, is there a way to do it locally?
I am referring to long building time of docs.