-
Notifications
You must be signed in to change notification settings - Fork 89
107 lines (88 loc) · 3.48 KB
/
generateDocs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Generate GitHub Pages
on:
push:
branches:
- main
# pull_request:
workflow_dispatch:
jobs:
build-docs:
name: Generate Documentation
runs-on: ubuntu-latest
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
contents: write
steps:
- name: Configure Environment
run: echo "$GITHUB_WORKSPACE/llvm/install/bin" >> $GITHUB_PATH
# Clone the repo and its submodules. Do shallow clone to save clone
# time.
- name: Get the project repository
uses: actions/checkout@v4
with:
fetch-depth: 2
submodules: "true"
- name: Install packages
run: sudo apt-get install -y graphviz lld
- name: Install Python packages
run: sudo pip install psutil rich numpy pybind11
- name: Install Ninja
# https://github.com/llvm/actions/tree/main/install-ninja
uses: llvm/actions/install-ninja@6a57890d0e3f9f35dfc72e7e48bc5e1e527cdd6c
- name: Get Submodule Hash
id: get-submodule-hash
run: echo "hash=$(md5sum $(echo utils/clone-llvm.sh))" >> $GITHUB_OUTPUT
shell: bash
- name: Ccache for C++ compilation
# https://github.com/hendrikmuhs/ccache-action/releases/tag/v1.2.9
uses: hendrikmuhs/[email protected]
with:
key: ${{ runner.os }}-releaseasserts-${{ steps.get-submodule-hash.outputs.hash }}
max-size: 1G
- name: Get cmakeModules
id: clone-cmakeModules
run: git clone --depth 1 https://github.com/Xilinx/cmakeModules.git
shell: bash
- name: Get MLIR
id: mlir-wheels
run: |
VERSION=$(utils/clone-llvm.sh --get-wheel-version)
pip -q download mlir==$VERSION \
-f https://github.com/Xilinx/mlir-aie/releases/expanded_assets/mlir-distro
unzip -q mlir-*.whl
WHL=$(ls mlir-*.whl)
echo "MLIR_WHEEL_VERSION=$VERSION" | tee -a $GITHUB_OUTPUT
echo "MLIR_DIR=$PWD/mlir" | tee -a $GITHUB_OUTPUT
# Build the repo test target in release mode to build and test.
- name: Build Docs
run: |
mkdir build_release
pushd build_release
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_ASSERTIONS=OFF \
-DCMAKE_MODULE_PATH=$PWD/../cmake/modulesXilinx \
-DMLIR_DIR=$PWD/../mlir/lib/cmake/mlir \
-DLLVM_DIR=$PWD/../mlir/lib/cmake/llvm \
-DLLVM_USE_LINKER=lld \
-DAIE_INCLUDE_DOCS=ON \
-DAIE_ENABLE_PYTHON_PASSES=OFF \
-DLLVM_EXTERNAL_LIT=$(which lit)
make docs
popd
cp -r docs/* build_release/docs
dot -Tpng docs/dialects.dot > build_release/docs/dialects.png
dot -Tsvg docs/dialects.dot > build_release/docs/dialects.svg
- name: Save MLIR Version
run: |
echo "{" > build_release/docs/build_info.json
echo "llvm-version: \"${{ steps.mlir-wheels.outputs.MLIR_WHEEL_VERSION }}\"," >> build_release/docs/build_info.json
echo "}" > build_release/docs/build_info.json
- name: Publish to GitHub-Pages
if: github.event_name != 'pull_request'
# https://github.com/peaceiris/actions-gh-pages/releases/tag/v3.9.3
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build_release/docs
enable_jekyll: true