colossalai
76 строк · 2.4 Кб
1name: Check Documentation on PR
2
3on:
4pull_request:
5branches:
6- "main"
7- "develop"
8- "feature/**"
9paths:
10- "docs/**"
11
12jobs:
13check-i18n:
14name: Check docs in diff languages
15if: |
16github.event.pull_request.draft == false &&
17github.event.pull_request.base.repo.full_name == 'hpcaitech/ColossalAI'
18runs-on: ubuntu-latest
19concurrency:
20group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-check-i18n
21cancel-in-progress: true
22steps:
23- uses: actions/checkout@v2
24
25- uses: actions/setup-python@v2
26with:
27python-version: "3.8.14"
28
29- run: python .github/workflows/scripts/check_doc_i18n.py -d docs/source
30
31check-doc-build:
32name: Test if the docs can be built
33if: |
34github.event.pull_request.draft == false &&
35github.event.pull_request.base.repo.full_name == 'hpcaitech/ColossalAI'
36runs-on: ubuntu-latest
37concurrency:
38group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-check-doc
39cancel-in-progress: true
40steps:
41- uses: actions/checkout@v2
42with:
43path: "./ColossalAI"
44fetch-depth: 0
45
46- uses: actions/checkout@v2
47with:
48path: "./ColossalAI-Documentation"
49repository: "hpcaitech/ColossalAI-Documentation"
50
51- uses: actions/setup-python@v2
52with:
53python-version: "3.8.14"
54
55# we use the versions in the main branch as the guide for versions to display
56# checkout will give your merged branch
57# therefore, we need to make the merged branch as the main branch
58# there is no main branch, so it's safe to checkout the main branch from the merged branch
59# docer will rebase the remote main branch to the merged branch, so we have to config user
60- name: Make the merged branch main
61run: |
62cd ColossalAI
63git checkout -b main
64git branch -u origin/main
65git config user.name 'github-actions'
66git config user.email 'github-actions@github.com'
67
68- name: Build docs
69run: |
70cache_dir=ColossalAI-Documentation/doc-build/.cache
71mkdir $cache_dir
72mv ColossalAI $cache_dir
73cd ColossalAI-Documentation
74pip install -v ./doc-build/third_party/hf-doc-builder
75pip install -v ./doc-build
76bash ./scripts/build.sh
77