Skip to content

Commit 6172e96

Browse files
authored
Fix doc build (#2050)
* Fix doc build * Trigger PR doc build when the PR doc build workflow is modified * Fix issue with torch-xla and ubuntu-latest
1 parent 4ce7364 commit 6172e96

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

.github/workflows/build_main_documentation.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010

1111
jobs:
1212
build_documentation:
13-
runs-on: ubuntu-latest
13+
runs-on: ubuntu-22.04
1414

1515
steps:
1616
- uses: actions/checkout@v2
@@ -66,7 +66,7 @@ jobs:
6666
sudo apt-get purge -y '^mysql.*'
6767
sudo apt-get purge -y '^java.*'
6868
sudo apt-get purge -y '^openjdk.*'
69-
sudo apt-get purge -y microsoft-edge-stable google-cloud-cli azure-cli google-chrome-stable firefox powershell mono-devel
69+
sudo apt-get purge -y microsoft-edge-stable azure-cli google-chrome-stable firefox mono-devel
7070
df -h
7171
sudo apt-get autoremove -y >/dev/null 2>&1
7272
sudo apt-get clean
@@ -110,6 +110,8 @@ jobs:
110110
111111
- name: Setup environment
112112
run: |
113+
python -m venv venv-doc
114+
source venv-doc/bin/activate
113115
pip uninstall -y doc-builder
114116
cd doc-builder
115117
git pull origin main
@@ -135,6 +137,7 @@ jobs:
135137
136138
- name: Make Furiosa documentation
137139
run: |
140+
source venv-doc/bin/activate
138141
cd optimum-furiosa
139142
pip install .
140143
sudo apt install software-properties-common
@@ -159,6 +162,7 @@ jobs:
159162
- name: Make TPU documentation
160163
run: |
161164
sudo docker system prune -a -f
165+
source venv-doc/bin/activate
162166
cd optimum-tpu
163167
pip install -U pip
164168
pip install . -f https://storage.googleapis.com/libtpu-releases/index.html

.github/workflows/build_pr_documentation.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ on:
88
- "optimum/**.py"
99
- "docs/**.mdx"
1010
- "docs/**.yml"
11+
- ".github/workflows/build_pr_documentation.yml"
1112

1213
concurrency:
1314
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1415
cancel-in-progress: true
1516

1617
jobs:
1718
build_documentation:
18-
runs-on: ubuntu-latest
19+
runs-on: ubuntu-22.04
1920
env:
2021
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
2122
PR_NUMBER: ${{ github.event.number }}
@@ -60,6 +61,8 @@ jobs:
6061

6162
- name: Setup environment
6263
run: |
64+
python -m venv venv-doc
65+
source venv-doc/bin/activate
6366
pip uninstall -y doc-builder
6467
cd doc-builder
6568
git pull origin main
@@ -99,6 +102,7 @@ jobs:
99102
- name: Make TPU documentation
100103
run: |
101104
sudo docker system prune -a -f
105+
source venv-doc/bin/activate
102106
cd optimum-tpu
103107
pip install -U pip
104108
pip install . -f https://storage.googleapis.com/libtpu-releases/index.html

0 commit comments

Comments
 (0)