mirror of https://github.com/hpcaitech/ColossalAI
[workflow] added doc build test (#2675)
* [workflow] added doc build test * polish code * polish code * polish code * polish code * polish code * polish code * polish code * polish code * polish codepull/2678/head
parent
8213f89fd2
commit
327bc06278
|
@ -21,3 +21,48 @@ jobs:
|
|||
python-version: '3.8.14'
|
||||
|
||||
- run: python .github/workflows/scripts/check_doc_i18n.py -d docs/source
|
||||
|
||||
check-doc-build:
|
||||
name: Test if the docs can be built
|
||||
if: |
|
||||
github.event.pull_request.draft == false &&
|
||||
github.base_ref == 'main' &&
|
||||
github.event.pull_request.base.repo.full_name == 'hpcaitech/ColossalAI'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
path: './ColossalAI'
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
path: './ColossalAI-Documentation'
|
||||
repository: 'hpcaitech/ColossalAI-Documentation'
|
||||
|
||||
- uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.8.14'
|
||||
|
||||
- run: |
|
||||
ls -la
|
||||
ls -la ..
|
||||
|
||||
# we use the versions in the main branch as the guide for versions to display
|
||||
# checkout will give your merged branch
|
||||
# therefore, we need to make the merged branch as the main branch
|
||||
- name: Make the merged branch main
|
||||
run: |
|
||||
cd ColossalAI
|
||||
curBranch=$(git rev-parse --abbrev-ref HEAD)
|
||||
git checkout main
|
||||
git merge $curBranch # fast-forward master up to the merge
|
||||
|
||||
- name: Build docs
|
||||
run: |
|
||||
cache_dir=ColossalAI-Documentation/doc-build/.cache
|
||||
mkdir $cache_dir
|
||||
mv ColossalAI $cache_dir
|
||||
cd ColossalAI-Documentation
|
||||
pip install -v ./doc-build
|
||||
bash ./scripts/build.sh
|
||||
|
|
Loading…
Reference in New Issue