From c8d7ff62b3da638e59a1f560b7ae690f18f15cf2 Mon Sep 17 00:00:00 2001 From: Lawrence Mitchell Date: Tue, 11 May 2021 11:41:20 +0100 Subject: [PATCH] actions: Build docs at end of successful test run --- .github/workflows/ci.yml | 26 ++++++++++++---- .github/workflows/gh-pages.yml | 55 ---------------------------------- 2 files changed, 20 insertions(+), 61 deletions(-) delete mode 100644 .github/workflows/gh-pages.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ffd53b3c26..8458ee6638 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,15 +17,14 @@ jobs: CC: mpicc PETSC_DIR: ${{ github.workspace }}/petsc PETSC_ARCH: default - PETSC_CONFIGURE_OPTIONS: --with-debugging=1 --with-shared-libraries=1 + PETSC_CONFIGURE_OPTIONS: --with-debugging=1 --with-shared-libraries=1 --with-c2html=0 --with-fortran-bindings=0 steps: - name: Install system dependencies shell: bash run: | - sudo apt install \ - build-essential python3-dev git python3-pip libopenmpi-dev \ - openmpi-bin libblas-dev liblapack-dev gfortran + sudo apt install build-essential mpich libmpich-dev \ + libblas-dev liblapack-dev gfortran - name: Set correct Python version uses: actions/setup-python@v2 @@ -56,13 +55,13 @@ jobs: uses: actions/checkout@v2 with: path: PyOP2 - + - name: Install PyOP2 shell: bash working-directory: PyOP2 run: | python -m pip install pip==20.2 # pip 20.2 needed for loopy install to work. - + # xargs is used to force installation of requirements in the order we specified. xargs -l1 python -m pip install < requirements-ext.txt xargs -l1 python -m pip install < requirements-git.txt @@ -79,3 +78,18 @@ jobs: shell: bash working-directory: PyOP2 run: pytest test -v --tb=native + + - name: Build documentation + shell: bash + working-directory: PyOP2 + run: | + python -m pip install sphinx + make -C doc/sphinx html + - name: Upload to github pages + if: ${{ github.ref == 'refs/heads/master' && github.event_name == 'push' }} + uses: crazy-max/ghaction-github-pages@v2.2.0 + with: + build_dir: PyOP2/doc/sphinx/build/html + jekyll: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml deleted file mode 100644 index 1fbc8ee179..0000000000 --- a/.github/workflows/gh-pages.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Build Website - -on: - push: - branches: - - master - -jobs: - gh-pages: - runs-on: ubuntu-latest - env: - CC: mpicc - PETSC_CONFIGURE_OPTIONS: --with-debugging=1 - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Install system dependencies - shell: bash - run: | - sudo apt install \ - build-essential python3-dev git python3-pip libopenmpi-dev \ - openmpi-bin libblas-dev liblapack-dev gfortran - - - name: Set correct Python version - uses: actions/setup-python@v2 - with: - python-version: '3.6' - - # xargs is used to force installation of requirements in the order we specified. - # pip 20.2 needed for loopy install to work. - - name: Install Python dependencies - shell: bash - run: | - pip install pip==20.2 - xargs -l1 pip install < requirements-ext.txt - xargs -l1 pip install < requirements-git.txt - pip install pulp sphinx - pip install -U flake8 - - - name: Install PyOP2 - shell: bash - run: pip install -e . - - - name: Build documentation - shell: bash - run: make -C doc/sphinx html - - - name: Upload to GitHub Pages - uses: crazy-max/ghaction-github-pages@v2.2.0 - with: - build_dir: doc/sphinx/build/html - jekyll: false - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}