Unverified Commit ad93c736 authored by Frank Lee's avatar Frank Lee Committed by GitHub
Browse files

[workflow] enable testing for develop & feature branch (#3801)

parent ef02d7ef
...@@ -3,24 +3,27 @@ name: Build on PR ...@@ -3,24 +3,27 @@ name: Build on PR
on: on:
pull_request: pull_request:
types: [synchronize, opened, reopened] types: [synchronize, opened, reopened]
branches:
- "main"
- "develop"
- "feature/**"
paths: paths:
- '.github/workflows/build_on_pr.yml' # run command & env variables change - ".github/workflows/build_on_pr.yml" # run command & env variables change
- 'colossalai/**' # source code change - "colossalai/**" # source code change
- '!colossalai/**.md' # ignore doc change - "!colossalai/**.md" # ignore doc change
- 'op_builder/**' # cuda extension change - "op_builder/**" # cuda extension change
- '!op_builder/**.md' # ignore doc change - "!op_builder/**.md" # ignore doc change
- 'requirements/**' # requirements change - "requirements/**" # requirements change
- 'tests/**' # test change - "tests/**" # test change
- '!tests/**.md' # ignore doc change - "!tests/**.md" # ignore doc change
- 'pytest.ini' # test config change - "pytest.ini" # test config change
- 'setup.py' # install command change - "setup.py" # install command change
jobs: jobs:
detect: detect:
name: Detect file change name: Detect file change
if: | if: |
github.event.pull_request.draft == false && github.event.pull_request.draft == false &&
github.base_ref == 'main' &&
github.event.pull_request.base.repo.full_name == 'hpcaitech/ColossalAI' github.event.pull_request.base.repo.full_name == 'hpcaitech/ColossalAI'
outputs: outputs:
changedExtenisonFiles: ${{ steps.find-extension-change.outputs.all_changed_files }} changedExtenisonFiles: ${{ steps.find-extension-change.outputs.all_changed_files }}
......
...@@ -2,15 +2,18 @@ name: Check Documentation on PR ...@@ -2,15 +2,18 @@ name: Check Documentation on PR
on: on:
pull_request: pull_request:
branches:
- "main"
- "develop"
- "feature/**"
paths: paths:
- 'docs/**' - "docs/**"
jobs: jobs:
check-i18n: check-i18n:
name: Check docs in diff languages name: Check docs in diff languages
if: | if: |
github.event.pull_request.draft == false && github.event.pull_request.draft == false &&
github.base_ref == 'main' &&
github.event.pull_request.base.repo.full_name == 'hpcaitech/ColossalAI' github.event.pull_request.base.repo.full_name == 'hpcaitech/ColossalAI'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
...@@ -18,7 +21,7 @@ jobs: ...@@ -18,7 +21,7 @@ jobs:
- uses: actions/setup-python@v2 - uses: actions/setup-python@v2
with: with:
python-version: '3.8.14' python-version: "3.8.14"
- run: python .github/workflows/scripts/check_doc_i18n.py -d docs/source - run: python .github/workflows/scripts/check_doc_i18n.py -d docs/source
...@@ -26,23 +29,22 @@ jobs: ...@@ -26,23 +29,22 @@ jobs:
name: Test if the docs can be built name: Test if the docs can be built
if: | if: |
github.event.pull_request.draft == false && github.event.pull_request.draft == false &&
github.base_ref == 'main' &&
github.event.pull_request.base.repo.full_name == 'hpcaitech/ColossalAI' github.event.pull_request.base.repo.full_name == 'hpcaitech/ColossalAI'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
path: './ColossalAI' path: "./ColossalAI"
fetch-depth: 0 fetch-depth: 0
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
path: './ColossalAI-Documentation' path: "./ColossalAI-Documentation"
repository: 'hpcaitech/ColossalAI-Documentation' repository: "hpcaitech/ColossalAI-Documentation"
- uses: actions/setup-python@v2 - uses: actions/setup-python@v2
with: with:
python-version: '3.8.14' python-version: "3.8.14"
# we use the versions in the main branch as the guide for versions to display # we use the versions in the main branch as the guide for versions to display
# checkout will give your merged branch # checkout will give your merged branch
...@@ -57,7 +59,6 @@ jobs: ...@@ -57,7 +59,6 @@ jobs:
git config user.name 'github-actions' git config user.name 'github-actions'
git config user.email 'github-actions@github.com' git config user.email 'github-actions@github.com'
- name: Build docs - name: Build docs
run: | run: |
cache_dir=ColossalAI-Documentation/doc-build/.cache cache_dir=ColossalAI-Documentation/doc-build/.cache
......
name: Test Documentation on PR name: Test Documentation on PR
on: on:
pull_request: pull_request:
branches:
- "main"
- "develop"
- "feature/**"
# any change in the examples folder will trigger check for the corresponding example. # any change in the examples folder will trigger check for the corresponding example.
paths: paths:
- 'docs/source/**.md' - "docs/source/**.md"
jobs: jobs:
# This is for changed example files detect and output a matrix containing all the corresponding directory name. # This is for changed example files detect and output a matrix containing all the corresponding directory name.
detect-changed-doc: detect-changed-doc:
if: | if: |
github.event.pull_request.draft == false && github.event.pull_request.draft == false &&
github.base_ref == 'main' &&
github.event.pull_request.base.repo.full_name == 'hpcaitech/ColossalAI' && github.event_name == 'pull_request' github.event.pull_request.base.repo.full_name == 'hpcaitech/ColossalAI' && github.event_name == 'pull_request'
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:
...@@ -44,7 +47,6 @@ jobs: ...@@ -44,7 +47,6 @@ jobs:
# Add this condition to avoid executing this job if the trigger event is workflow_dispatch. # Add this condition to avoid executing this job if the trigger event is workflow_dispatch.
if: | if: |
github.event.pull_request.draft == false && github.event.pull_request.draft == false &&
github.base_ref == 'main' &&
github.event.pull_request.base.repo.full_name == 'hpcaitech/ColossalAI' && github.event_name == 'pull_request' && github.event.pull_request.base.repo.full_name == 'hpcaitech/ColossalAI' && github.event_name == 'pull_request' &&
needs.detect-changed-doc.outputs.any_changed == 'true' needs.detect-changed-doc.outputs.any_changed == 'true'
name: Test the changed Doc name: Test the changed Doc
...@@ -61,8 +63,8 @@ jobs: ...@@ -61,8 +63,8 @@ jobs:
- name: Checkout ColossalAI-Documentation - name: Checkout ColossalAI-Documentation
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
path: './ColossalAI-Documentation' path: "./ColossalAI-Documentation"
repository: 'hpcaitech/ColossalAI-Documentation' repository: "hpcaitech/ColossalAI-Documentation"
- name: Install Docer - name: Install Docer
run: | run: |
......
name: Test Example on PR name: Test Example on PR
on: on:
pull_request: pull_request:
branches:
- "main"
- "develop"
- "feature/**"
# any change in the examples folder will trigger check for the corresponding example. # any change in the examples folder will trigger check for the corresponding example.
paths: paths:
- 'examples/**' - "examples/**"
jobs: jobs:
# This is for changed example files detect and output a matrix containing all the corresponding directory name. # This is for changed example files detect and output a matrix containing all the corresponding directory name.
detect-changed-example: detect-changed-example:
if: | if: |
github.event.pull_request.draft == false && github.event.pull_request.draft == false &&
github.base_ref == 'main' &&
github.event.pull_request.base.repo.full_name == 'hpcaitech/ColossalAI' && github.event_name == 'pull_request' github.event.pull_request.base.repo.full_name == 'hpcaitech/ColossalAI' && github.event_name == 'pull_request'
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:
...@@ -62,7 +65,6 @@ jobs: ...@@ -62,7 +65,6 @@ jobs:
# Add this condition to avoid executing this job if the trigger event is workflow_dispatch. # Add this condition to avoid executing this job if the trigger event is workflow_dispatch.
if: | if: |
github.event.pull_request.draft == false && github.event.pull_request.draft == false &&
github.base_ref == 'main' &&
github.event.pull_request.base.repo.full_name == 'hpcaitech/ColossalAI' && github.event_name == 'pull_request' && github.event.pull_request.base.repo.full_name == 'hpcaitech/ColossalAI' && github.event_name == 'pull_request' &&
needs.detect-changed-example.outputs.anyChanged == 'true' needs.detect-changed-example.outputs.anyChanged == 'true'
name: Test the changed example name: Test the changed example
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment