-
Notifications
You must be signed in to change notification settings - Fork 89
80 lines (77 loc) · 2.23 KB
/
_build_doc.yaml
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
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
on:
workflow_call:
inputs:
torch:
type: string
default: '2.5.1'
py:
type: string
default: '3.12'
version_override:
type: string
default: ''
jobs:
build:
name: Build
runs-on:
labels: 4-core-ubuntu
container:
image: ghcr.io/facebookresearch/fairseq2-ci-manylinux_x86_64:3-cpu
defaults:
run:
shell: bash
steps:
- name: Install Git LFS
run: |
yum install -y git-lfs
- name: Check-out the repository
uses: actions/checkout@v3
with:
lfs: true
submodules: recursive
- name: Create the Python virtual environment
run: |
python${{ inputs.py }} -m venv ~/venv
echo ~/venv/bin >> "$GITHUB_PATH"
- name: Install PyTorch
run: |
pip install --extra-index-url https://download.pytorch.org/whl/cpu\
torch==${{ inputs.torch }}
- name: Install requirements
run: |
pip install --requirement native/python/requirements-build.txt
- name: Install Sphinx
run: |
pip install --requirement doc/requirements.txt
- name: Override project version
if: inputs.version_override
run: |
tools/set-project-version.sh ${{ inputs.version_override }}
- name: Configure fairseq2n
working-directory: native
run: |
scl enable gcc-toolset-11 "cmake -GNinja -B build"
- name: Install fairseq2n
run: |
pip install --editable native/python
- name: Install fairseq2
run: |
pip install --editable .
- name: Generate documentation
working-directory: doc
run: |
make html SPHINXOPTS="-W"
- name: Copy VERSION into the documentation
run: |
cp VERSION doc/build/html
- name: Upload documentation to staging
uses: actions/upload-artifact@v4
with:
name: doc
path: doc/build/html/
retention-days: 1