Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ColossalAI
Commits
ad93c736
Unverified
Commit
ad93c736
authored
May 23, 2023
by
Frank Lee
Committed by
GitHub
May 23, 2023
Browse files
[workflow] enable testing for develop & feature branch (#3801)
parent
ef02d7ef
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
50 deletions
+58
-50
.github/workflows/build_on_pr.yml
.github/workflows/build_on_pr.yml
+14
-11
.github/workflows/doc_check_on_pr.yml
.github/workflows/doc_check_on_pr.yml
+14
-13
.github/workflows/doc_test_on_pr.yml
.github/workflows/doc_test_on_pr.yml
+16
-14
.github/workflows/example_check_on_pr.yml
.github/workflows/example_check_on_pr.yml
+14
-12
No files found.
.github/workflows/build_on_pr.yml
View file @
ad93c736
...
...
@@ -3,24 +3,27 @@ name: Build on PR
on
:
pull_request
:
types
:
[
synchronize
,
opened
,
reopened
]
branches
:
-
"
main"
-
"
develop"
-
"
feature/**"
paths
:
-
'
.github/workflows/build_on_pr.yml
'
# run command & env variables change
-
'
colossalai/**
'
# source code change
-
'
!colossalai/**.md
'
# ignore doc change
-
'
op_builder/**
'
# cuda extension change
-
'
!op_builder/**.md
'
# ignore doc change
-
'
requirements/**
'
# requirements change
-
'
tests/**
'
# test change
-
'
!tests/**.md
'
# ignore doc change
-
'
pytest.ini
'
# test config change
-
'
setup.py
'
# install command change
-
"
.github/workflows/build_on_pr.yml
"
# run command & env variables change
-
"
colossalai/**
"
# source code change
-
"
!colossalai/**.md
"
# ignore doc change
-
"
op_builder/**
"
# cuda extension change
-
"
!op_builder/**.md
"
# ignore doc change
-
"
requirements/**
"
# requirements change
-
"
tests/**
"
# test change
-
"
!tests/**.md
"
# ignore doc change
-
"
pytest.ini
"
# test config change
-
"
setup.py
"
# install command change
jobs
:
detect
:
name
:
Detect file change
if
:
|
github.event.pull_request.draft == false &&
github.base_ref == 'main' &&
github.event.pull_request.base.repo.full_name == 'hpcaitech/ColossalAI'
outputs
:
changedExtenisonFiles
:
${{ steps.find-extension-change.outputs.all_changed_files }}
...
...
.github/workflows/doc_check_on_pr.yml
View file @
ad93c736
...
...
@@ -2,47 +2,49 @@ name: Check Documentation on PR
on
:
pull_request
:
branches
:
-
"
main"
-
"
develop"
-
"
feature/**"
paths
:
-
'
docs/**
'
-
"
docs/**
"
jobs
:
check-i18n
:
name
:
Check docs in diff languages
if
:
|
github.event.pull_request.draft == false &&
github.base_ref == 'main' &&
github.event.pull_request.base.repo.full_name == 'hpcaitech/ColossalAI'
github.event.pull_request.draft == false &&
github.event.pull_request.base.repo.full_name == 'hpcaitech/ColossalAI'
runs-on
:
ubuntu-latest
steps
:
-
uses
:
actions/checkout@v2
-
uses
:
actions/setup-python@v2
with
:
python-version
:
'
3.8.14
'
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'
github.event.pull_request.draft == false &&
github.event.pull_request.base.repo.full_name == 'hpcaitech/ColossalAI'
runs-on
:
ubuntu-latest
steps
:
-
uses
:
actions/checkout@v2
with
:
path
:
'
./ColossalAI
'
path
:
"
./ColossalAI
"
fetch-depth
:
0
-
uses
:
actions/checkout@v2
with
:
path
:
'
./ColossalAI-Documentation
'
repository
:
'
hpcaitech/ColossalAI-Documentation
'
path
:
"
./ColossalAI-Documentation
"
repository
:
"
hpcaitech/ColossalAI-Documentation
"
-
uses
:
actions/setup-python@v2
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
# checkout will give your merged branch
...
...
@@ -57,7 +59,6 @@ jobs:
git config user.name 'github-actions'
git config user.email 'github-actions@github.com'
-
name
:
Build docs
run
:
|
cache_dir=ColossalAI-Documentation/doc-build/.cache
...
...
.github/workflows/doc_test_on_pr.yml
View file @
ad93c736
name
:
Test Documentation on PR
on
:
pull_request
:
branches
:
-
"
main"
-
"
develop"
-
"
feature/**"
# any change in the examples folder will trigger check for the corresponding example.
paths
:
-
'
docs/source/**.md
'
-
"
docs/source/**.md
"
jobs
:
# This is for changed example files detect and output a matrix containing all the corresponding directory name.
detect-changed-doc
:
if
:
|
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.draft == false &&
github.event.pull_request.base.repo.full_name == 'hpcaitech/ColossalAI' && github.event_name == 'pull_request'
runs-on
:
ubuntu-latest
outputs
:
any_changed
:
${{ steps.changed-files.outputs.any_changed }}
...
...
@@ -26,10 +29,10 @@ jobs:
-
name
:
Locate base commit
id
:
locate-base-sha
run
:
|
curBranch=$(git rev-parse --abbrev-ref HEAD)
commonCommit=$(git merge-base origin/main $curBranch)
echo $commonCommit
echo "baseSHA=$commonCommit" >> $GITHUB_OUTPUT
curBranch=$(git rev-parse --abbrev-ref HEAD)
commonCommit=$(git merge-base origin/main $curBranch)
echo $commonCommit
echo "baseSHA=$commonCommit" >> $GITHUB_OUTPUT
-
name
:
Get all changed example files
id
:
changed-files
...
...
@@ -43,10 +46,9 @@ jobs:
check-changed-doc
:
# Add this condition to avoid executing this job if the trigger event is workflow_dispatch.
if
:
|
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' &&
needs.detect-changed-doc.outputs.any_changed == 'true'
github.event.pull_request.draft == false &&
github.event.pull_request.base.repo.full_name == 'hpcaitech/ColossalAI' && github.event_name == 'pull_request' &&
needs.detect-changed-doc.outputs.any_changed == 'true'
name
:
Test the changed Doc
needs
:
detect-changed-doc
runs-on
:
[
self-hosted
,
gpu
]
...
...
@@ -61,8 +63,8 @@ jobs:
-
name
:
Checkout ColossalAI-Documentation
uses
:
actions/checkout@v2
with
:
path
:
'
./ColossalAI-Documentation
'
repository
:
'
hpcaitech/ColossalAI-Documentation
'
path
:
"
./ColossalAI-Documentation
"
repository
:
"
hpcaitech/ColossalAI-Documentation
"
-
name
:
Install Docer
run
:
|
...
...
.github/workflows/example_check_on_pr.yml
View file @
ad93c736
name
:
Test Example on PR
on
:
pull_request
:
branches
:
-
"
main"
-
"
develop"
-
"
feature/**"
# any change in the examples folder will trigger check for the corresponding example.
paths
:
-
'
examples/**
'
-
"
examples/**
"
jobs
:
# This is for changed example files detect and output a matrix containing all the corresponding directory name.
detect-changed-example
:
if
:
|
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.draft == false &&
github.event.pull_request.base.repo.full_name == 'hpcaitech/ColossalAI' && github.event_name == 'pull_request'
runs-on
:
ubuntu-latest
outputs
:
matrix
:
${{ steps.setup-matrix.outputs.matrix }}
...
...
@@ -26,10 +29,10 @@ jobs:
-
name
:
Locate base commit
id
:
locate-base-sha
run
:
|
curBranch=$(git rev-parse --abbrev-ref HEAD)
commonCommit=$(git merge-base origin/main $curBranch)
echo $commonCommit
echo "baseSHA=$commonCommit" >> $GITHUB_OUTPUT
curBranch=$(git rev-parse --abbrev-ref HEAD)
commonCommit=$(git merge-base origin/main $curBranch)
echo $commonCommit
echo "baseSHA=$commonCommit" >> $GITHUB_OUTPUT
-
name
:
Get all changed example files
id
:
changed-files
...
...
@@ -61,10 +64,9 @@ jobs:
check-changed-example
:
# Add this condition to avoid executing this job if the trigger event is workflow_dispatch.
if
:
|
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' &&
needs.detect-changed-example.outputs.anyChanged == 'true'
github.event.pull_request.draft == false &&
github.event.pull_request.base.repo.full_name == 'hpcaitech/ColossalAI' && github.event_name == 'pull_request' &&
needs.detect-changed-example.outputs.anyChanged == 'true'
name
:
Test the changed example
needs
:
detect-changed-example
runs-on
:
[
self-hosted
,
gpu
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment