Skip to content

Commit df03e53

Browse files
Add action to build dpctl using oneAPI and generate docs
1 parent 2ed58e2 commit df03e53

File tree

1 file changed

+94
-0
lines changed

1 file changed

+94
-0
lines changed

.github/workflows/generate-docs.yml

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

0 commit comments

Comments
 (0)