|
| 1 | +name: Generate documentation |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - master |
| 6 | + |
| 7 | +jobs: |
| 8 | + build-and-deploy: |
| 9 | + name: Build and Deploy Documentation |
| 10 | + runs-on: ubuntu-20.04 |
| 11 | + steps: |
| 12 | + - name: Cancel Previous Runs |
| 13 | + uses: styfle/cancel-workflow-action@0.6.0 |
| 14 | + with: |
| 15 | + access_token: ${{ github.token }} |
| 16 | + - name: Add Intel repository |
| 17 | + run: | |
| 18 | + wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB |
| 19 | + sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB |
| 20 | + rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB |
| 21 | + sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main" |
| 22 | + sudo apt-get update |
| 23 | + - name: Install Intel OneAPI |
| 24 | + run: | |
| 25 | + sudo apt-get install intel-oneapi-dpcpp-cpp-compiler |
| 26 | + - name: Install Level-Zero headers |
| 27 | + run: | |
| 28 | + sudo apt-get install -y gpg-agent wget |
| 29 | + wget -qO - https://repositories.intel.com/graphics/intel-graphics.key | |
| 30 | + sudo apt-key add - |
| 31 | + sudo apt-add-repository \ |
| 32 | + 'deb [arch=amd64] https://repositories.intel.com/graphics/ubuntu focal main' |
| 33 | + sudo apt-get install level-zero level-zero-dev |
| 34 | + - name: Install Lua |
| 35 | + run: | |
| 36 | + sudo apt-get install liblua5.2-dev |
| 37 | + - name: Install Doxygen |
| 38 | + run: | |
| 39 | + sudo apt-get install doxygen |
| 40 | + - name: Install CMake |
| 41 | + run: | |
| 42 | + sudo apt-get install cmake |
| 43 | + - name: Setup Python |
| 44 | + uses: actions/setup-python@v2 |
| 45 | + with: |
| 46 | + python-version: '3.8' |
| 47 | + architecture: x64 |
| 48 | + - name: Install sphinx dependencies |
| 49 | + shell: bash -l {0} |
| 50 | + run: | |
| 51 | + pip install numpy cython setuptools sphinx sphinx_rtd_theme pydot graphviz |
| 52 | + - name: Checkout repo |
| 53 | + uses: actions/checkout@v2 |
| 54 | + with: |
| 55 | + fetch-depth: 0 |
| 56 | + - name: Build dpctl |
| 57 | + shell: bash -l {0} |
| 58 | + run: | |
| 59 | + source /opt/intel/oneapi/setvars.sh |
| 60 | + python setup.py develop |
| 61 | + python -c "import dpctl; print(dpctl.__version__)" |
| 62 | + - name: Build docs |
| 63 | + shell: bash -l {0} |
| 64 | + run: | |
| 65 | + # Ensure that SYCL libraries are on LD_LIBRARY_PATH |
| 66 | + source /opt/intel/oneapi/setvars.sh |
| 67 | + cd docs |
| 68 | + mkdir -p build && cd build && rm -rf * |
| 69 | + wget https://github.com/vovkos/doxyrest/releases/download/doxyrest-2.1.2/doxyrest-2.1.2-linux-amd64.tar.xz |
| 70 | + tar xf doxyrest-2.1.2-linux-amd64.tar.xz |
| 71 | + cmake .. -DDPCTL_USE_MULTIVERSION_TEMPLATE=ON \ |
| 72 | + -DDPCTL_ENABLE_DOXYREST=ON \ |
| 73 | + -DDoxyrest_DIR=`pwd`/doxyrest-2.1.2-linux-amd64 |
| 74 | + make Sphinx |
| 75 | + cd .. |
| 76 | + mv generated_docs/docs ~/docs |
| 77 | + git clean -dfx |
| 78 | + cd .. |
| 79 | + - name: Publish docs |
| 80 | + shell: bash -l {0} |
| 81 | + run: | |
| 82 | + git remote add tokened_docs https://IntelPython:${{ secrets.GITHUB_TOKEN }}@github.com/IntelPython/dpctl.git |
| 83 | + git fetch tokened_docs |
| 84 | + git checkout --track tokened_docs/gh-pages |
| 85 | + echo `pwd` |
| 86 | + cd master |
| 87 | + git rm -rf * |
| 88 | + mv ~/docs/* . |
| 89 | + git add . |
| 90 | + git config --global user.name 'github-actions[doc-deploy-bot]' |
| 91 | + git config --gloabl user.email 'github-actions[doc-deploy-bot]@users.noreply.github.com' |
| 92 | + git commit -m "Latest docs." |
| 93 | + git push tokened_docs gh-pages |
0 commit comments