From e7afc13104e2c7f1ea76a8795d937c4e127da3a0 Mon Sep 17 00:00:00 2001 From: Tom Begley Date: Mon, 21 Nov 2022 14:26:22 +0000 Subject: [PATCH] Rewrite docs workflow --- .github/workflows/docs.yml | 105 +++++++++++++------------------------ 1 file changed, 37 insertions(+), 68 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 06f2b6904..ab219c4bb 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -6,76 +6,45 @@ on: - main workflow_dispatch: jobs: - build_docs_job: - runs-on: ${{ matrix.os }} - strategy: - matrix: - include: - - os: linux.2xlarge - python-version: 3.8 + build-docs: + runs-on: ubuntu-18.04 + defaults: + run: + shell: bash -l {0} steps: - - name: Check ldd --version - run: ldd --version - - name: Checkout - uses: actions/checkout@v2 - # Update references - - name: Update pip - run: | - sudo yum update -y - sudo yum -y install git python3-pip - sudo pip3 install --upgrade pip - - name: Setup conda - run: | - rm -rf $HOME/miniconda - wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh - bash ~/miniconda.sh -b -p $HOME/miniconda - - name: Install gcc - shell: bash - run: | - sudo yum group install -y "Development Tools" - - name: setup Path - run: | - echo "/home/ec2-user/miniconda/bin" >> $GITHUB_PATH - echo "CONDA=/home/ec2-user/miniconda" >> $GITHUB_PATH - - name: create conda env - run: | - conda create --name build_binary python=${{ matrix.python-version }} - conda info - - name: check python version no Conda - run: | - python --version - - name: check python version - run: | - conda run -n build_binary python --version - - name: setup Path - run: | - echo /usr/local/bin >> $GITHUB_PATH - - name: Install PyTorch - shell: bash - run: | - conda run -n build_binary python -m pip install --pre torch -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html - - name: Install TensorDict - run: | - conda run -n build_binary python -m pip install -e . - - name: Test tensordict installation - shell: bash - run: | - mkdir _tmp - cd _tmp - conda run -n build_binary \ + - name: Checkout tensordict + uses: actions/checkout@v2 + - name: Setup Miniconda + uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: build_docs + python-version: "3.9" + - name: Check Python version + run: | + python --version + - name: Install PyTorch + run: | + python -m pip install torch + python -m pip install "git+https://github.com/pytorch/functorch.git@release/0.2" + - name: Install TensorDict + run: | + python -m pip install -e . + - name: Test tensordict installation + run: | + mkdir _tmp + cd _tmp python -c "import tensordict" - cd .. - - name: Build the docset - run: | - conda run -n build_binary python -m pip install -r docs/requirements.txt - cd ./docs - conda run -n build_binary make html - cd .. - - name: Get output time - run: echo "The time was ${{ steps.build.outputs.time }}" - - name: Deploy - uses: JamesIves/github-pages-deploy-action@releases/v3 - with: + cd .. + - name: Build the docset + working-directory: ./docs + run: | + python -m pip install -r requirements.txt + make html + - name: Get output time + run: echo "The time was ${{ steps.build.outputs.time }}" + - name: Deploy + uses: JamesIves/github-pages-deploy-action@releases/v3 + with: ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} BRANCH: gh-pages # The branch the action should deploy to. FOLDER: docs/build/html # The folder the action should deploy.