From 8fedc8766a7fc0c072337ac348b02b5da1037861 Mon Sep 17 00:00:00 2001 From: Frank Lee Date: Tue, 7 Mar 2023 14:21:26 +0800 Subject: [PATCH] [workflow] supported conda package installation in doc test (#3028) * [workflow] supported conda package installation in doc test * polish code * polish code * polish code * polish code * polish code * polish code --- .github/workflows/doc_check_on_pr.yml | 4 ---- .github/workflows/doc_test_on_pr.yml | 15 +++++++++++---- docs/README.md | 2 +- docs/conda-doc-test-deps.yml | 2 ++ 4 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 docs/conda-doc-test-deps.yml diff --git a/.github/workflows/doc_check_on_pr.yml b/.github/workflows/doc_check_on_pr.yml index 6593ac50e..2022c957f 100644 --- a/.github/workflows/doc_check_on_pr.yml +++ b/.github/workflows/doc_check_on_pr.yml @@ -44,10 +44,6 @@ jobs: 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 diff --git a/.github/workflows/doc_test_on_pr.yml b/.github/workflows/doc_test_on_pr.yml index a0572766f..a083362a7 100644 --- a/.github/workflows/doc_test_on_pr.yml +++ b/.github/workflows/doc_test_on_pr.yml @@ -54,6 +54,9 @@ jobs: image: hpcaitech/pytorch-cuda:1.12.0-11.3.0 options: --gpus all --rm timeout-minutes: 20 + defaults: + run: + shell: bash steps: - name: Checkout ColossalAI-Documentation uses: actions/checkout@v2 @@ -68,17 +71,21 @@ jobs: - name: Checkout ColossalAI uses: actions/checkout@v3 + + - name: Install Doc Test Requirements + run: | + source activate pytorch + conda env update --file docs/conda-doc-test-deps.yml --prune + pip install -r docs/requirements-doc-test.txt - name: Install ColossalAI run: | + source activate pytorch pip install -v . - - name: Install Doc Test Requirements - run: | - pip install -r docs/requirements-doc-test.txt - - name: Test the Doc run: | + source activate pytorch for file in ${{ steps.changed-files.outputs.all_changed_files }}; do echo "Testing $file now..." docer test -p $file diff --git a/docs/README.md b/docs/README.md index 7261a6bc7..d5e0c22f5 100644 --- a/docs/README.md +++ b/docs/README.md @@ -98,7 +98,7 @@ Lastly, if you want to skip some code, you just need to add the following annota ``` -If you have any dependency required, please add it to `requriements-doc-test.txt`. +If you have any dependency required, please add it to `requriements-doc-test.txt` for pip and `conda-doc-test-deps.yml` for conda. ### 💉 Auto Documentation diff --git a/docs/conda-doc-test-deps.yml b/docs/conda-doc-test-deps.yml new file mode 100644 index 000000000..74a232214 --- /dev/null +++ b/docs/conda-doc-test-deps.yml @@ -0,0 +1,2 @@ +dependencies: + - cmake