Skip to content

Commit 39dbd13

Browse files
committed
Install Executorch when building docs
1 parent a3e6480 commit 39dbd13

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

.github/workflows/doc-build.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,26 @@ jobs:
2020
job-name: Build doc
2121
runner: linux.2xlarge
2222
docker-image: executorch-ubuntu-22.04-clang12
23-
fetch-depth: 0
2423
submodules: 'true'
2524
repository: pytorch/executorch
2625
upload-artifact: docs
27-
2826
script: |
29-
# Set up Environment Variables
30-
PYTHON_VERSION=3.10
31-
export PATH="/opt/conda/envs/py_${PYTHON_VERSION}/bin:${PATH}"
27+
# The generic Linux job chooses to use base env, not the one setup by the image
28+
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
29+
conda activate "${CONDA_ENV}"
30+
31+
source .ci/scripts/utils.sh
32+
# This is a simple Python script but as it tries to import executorch.examples.models,
33+
# it requires a whole bunch of Executorch dependencies on the Docker image
34+
install_executorch
3235
3336
if [[(${GITHUB_EVENT_NAME} = 'pull_request' && (${GITHUB_BASE_REF} = 'release'*)) || (${GITHUB_REF} = 'refs/heads/release'*) ]]; then
3437
export CHANNEL=test
3538
else
3639
export CHANNEL=nightly
3740
fi
3841
39-
set -ex
40-
set +u
42+
set -eux
4143
4244
# Build docset:
4345
cd docs
@@ -48,7 +50,6 @@ jobs:
4850
4951
# Sometimes the artifact directory already contains an "html" subdir.
5052
rm -rf "${RUNNER_ARTIFACT_DIR}/html"
51-
5253
mv docs/_build/html "${RUNNER_ARTIFACT_DIR}"
5354
5455
# Enable preview later. Previews are available publicly
@@ -73,12 +74,13 @@ jobs:
7374
name: docs
7475
- name: Upload docs
7576
run: |
76-
7777
set -x
7878
git config user.name 'pytorchbot'
7979
git config user.email '[email protected]'
80+
8081
rm -rf main
8182
mv html main
83+
8284
git add --all main || true
8385
git commit -m "Auto-generating sphinx docs" || true
8486
git push -f

0 commit comments

Comments
 (0)