-
Notifications
You must be signed in to change notification settings - Fork 31
89 lines (85 loc) · 2.63 KB
/
sphinx_build.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
# Copyright Allo authors. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
name: "Build documentation"
on:
push:
branches:
- main
paths:
- '.github/workflows/**'
- 'docs/**'
- 'tutorials/**'
pull_request:
branches:
- main
paths:
- '.github/workflows/**'
- 'docs/**'
- 'tutorials/**'
jobs:
build:
# This job runs on Linux
runs-on: ubuntu-latest
container:
image: chhzh123/hcl-dialect:llvm-18.x-py3.12
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
# - name: Patch LLVM Project
# run: |
# cp externals/llvm_patch /root/llvm-project
# cd /root/llvm-project
# git apply llvm_patch
- name: Build HCL-MLIR
shell: bash
run: |
source activate hcl-dev
export SUBMOD_COMMIT=$(git rev-parse HEAD:externals/hcl_mlir)
cd /root/hcl-dialect
git remote update
git fetch
git checkout $SUBMOD_COMMIT
cd build
make -j4
cd tools/hcl/python_packages/hcl_core
python3 -m pip install -e .
- name: Build docs
shell: bash
run: |
source activate hcl-dev
export ALLO_HOME=$(pwd)
export LLVM_BUILD_DIR=/root/llvm-project/build
export PATH=${LLVM_BUILD_DIR}/bin:${PATH}
export PYTHONPATH=$ALLO_HOME:${PYTHONPATH}
export PYTHONPATH=/root/hcl-dialect/build/tools/hcl/python_packages/hcl_core:${PYTHONPATH}
python3 -m pip install -r requirements.txt
cd docs
python3 -m pip install -r requirements.txt
make html
- run: touch docs/build/html/.nojekyll
# Create an artifact of the html output using Github action: https://github.com/actions/upload-artifact
- uses: actions/upload-artifact@v4
with:
name: DocumentationHTML
path: docs/build/html/
deploy:
# https://github.com/JamesIves/github-pages-deploy-action?tab=readme-ov-file#operating-system-support-
concurrency: ci-${{ github.ref }}
# Create a separate job that does not use the docker container
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Download Artifacts 🔻 # The built project is downloaded into the 'DocumentationHTML' folder.
uses: actions/download-artifact@v4
with:
name: DocumentationHTML
- name: Deploy docs
uses: JamesIves/github-pages-deploy-action@releases/v3
if: github.event_name == 'push'
with:
ACCESS_TOKEN: ${{ secrets.DEPLOY_ACCESS_TOKEN }}
BRANCH: gh-pages
FOLDER: 'DocumentationHTML'