build: documentation generation made a separate workflow

This commit is contained in:
Mateusz Pusz
2020-11-05 08:31:33 +01:00
parent e9f35ecd10
commit 5f859f332e
2 changed files with 92 additions and 50 deletions

View File

@@ -22,7 +22,13 @@
name: mp-units CI name: mp-units CI
on: [push, pull_request] on:
push:
paths-ignore:
- 'docs/**'
pull_request:
paths-ignore:
- 'docs/**'
jobs: jobs:
conan: conan:
@@ -49,56 +55,8 @@ jobs:
CONAN_PASSWORD: ${{ secrets.CONAN_PASSWORD }} CONAN_PASSWORD: ${{ secrets.CONAN_PASSWORD }}
CONAN_UPLOAD: ${{ secrets.CONAN_UPLOAD }} CONAN_UPLOAD: ${{ secrets.CONAN_UPLOAD }}
CONAN_OPTIONS: mp-units:generate_docs=False CONAN_OPTIONS: mp-units:generate_docs=False
CONAN_CMAKE_GENERATOR: Ninja
CONAN_DOCKER_IMAGE: conanio/${{ matrix.compiler.name }}${{ matrix.compiler.version }} CONAN_DOCKER_IMAGE: conanio/${{ matrix.compiler.name }}${{ matrix.compiler.version }}
run: | run: |
export CONAN_`echo ${{ matrix.compiler.name }} | tr [:lower:] [:upper:]`_VERSIONS="${{ matrix.compiler.version }}" export CONAN_`echo ${{ matrix.compiler.name }} | tr [:lower:] [:upper:]`_VERSIONS="${{ matrix.compiler.version }}"
python build.py python build.py
docs:
needs: conan
name: Documentation
runs-on: ubuntu-20.04
env:
CC: gcc-10
CXX: g++-10
steps:
- uses: actions/checkout@v2
- name: Cache Conan data
uses: actions/cache@v2
env:
cache-name: cache-conan-data
with:
path: ~/.conan/data
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/metadata.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install Python dependencies
run: |
pip install -Ur docs/requirements.txt
- name: Install Conan
run: |
pip install -U conan
- name: Configure Conan
run: |
conan config init
conan remote add upload ${{ secrets.CONAN_UPLOAD }}
conan remote add linear-algebra https://api.bintray.com/conan/twonington/public-conan
- name: Install Conan dependencies
run: |
mkdir build && cd build
conan install .. -s compiler.cppstd=20 -s compiler.libcxx=libstdc++11 -e mp-units:CONAN_RUN_TESTS=True -b outdated -u
- name: Generate documentation
run: |
cmake ..
cmake --build . --target sphinx
- name: Deploy documentation
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/docs/sphinx

84
.github/workflows/documentation.yml vendored Normal file
View File

@@ -0,0 +1,84 @@
# The MIT License (MIT)
#
# Copyright (c) 2018 Mateusz Pusz
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
on: [push, pull_request]
# on:
# push:
# paths:
# - 'docs/**'
# pull_request:
# paths:
# - 'docs/**'
jobs:
docs:
name: Sphinx
runs-on: ubuntu-20.04
env:
CC: gcc-10
CXX: g++-10
steps:
- uses: actions/checkout@v2
- name: Cache Conan data
uses: actions/cache@v2
env:
cache-name: cache-conan-data
with:
path: ~/.conan/data
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/metadata.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install Python dependencies
run: |
pip install -Ur docs/requirements.txt
- name: Install Conan
run: |
pip install -U conan
- name: Configure Conan
run: |
conan config init
conan remote add upload ${{ secrets.CONAN_UPLOAD }}
conan remote add linear-algebra https://api.bintray.com/conan/twonington/public-conan
- name: Install Conan dependencies
env:
CONAN_CMAKE_GENERATOR: Ninja
run: |
mkdir build && cd build
conan install .. -s compiler.cppstd=20 -s compiler.libcxx=libstdc++11 -e mp-units:CONAN_RUN_TESTS=True -b outdated -u
- name: Generate documentation
run: |
pwd
ls -al
cmake .. -G Ninja
cmake --build . --target sphinx
- name: Deploy documentation
if: github.ref == 'refs/heads/master'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/docs/sphinx