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
0af79383
Unverified
Commit
0af79383
authored
Jan 26, 2023
by
Frank Lee
Committed by
GitHub
Jan 26, 2023
Browse files
[workflow] fixed changed file detection (#2515)
parent
a6a10616
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
0 deletions
+42
-0
.github/workflows/auto_example_check.yml
.github/workflows/auto_example_check.yml
+17
-0
.github/workflows/build.yml
.github/workflows/build.yml
+11
-0
.github/workflows/pre_commit.yml
.github/workflows/pre_commit.yml
+14
-0
No files found.
.github/workflows/auto_example_check.yml
View file @
0af79383
...
...
@@ -25,9 +25,21 @@ jobs:
with
:
fetch-depth
:
0
ref
:
${{ github.event.pull_request.head.sha }}
-
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
-
name
:
Get all changed example files
id
:
changed-files
uses
:
tj-actions/changed-files@v35
with
:
base_sha
:
${{ steps.locate-base-sha.outputs.baseSHA }}
-
name
:
setup matrix
id
:
setup-matrix
run
:
|
...
...
@@ -67,9 +79,11 @@ jobs:
timeout-minutes
:
10
steps
:
-
uses
:
actions/checkout@v3
-
name
:
Install Colossal-AI
run
:
|
pip install -v .
-
name
:
Test the example
run
:
|
example_dir=${{ matrix.directory }}
...
...
@@ -90,6 +104,7 @@ jobs:
steps
:
-
name
:
📚 Checkout
uses
:
actions/checkout@v3
-
name
:
setup matrix
id
:
setup-matrix
run
:
|
...
...
@@ -113,9 +128,11 @@ jobs:
steps
:
-
name
:
📚 Checkout
uses
:
actions/checkout@v3
-
name
:
Install Colossal-AI
run
:
|
pip install -v .
-
name
:
Traverse all files
run
:
|
example_dir=${{ matrix.diretory }}
...
...
.github/workflows/build.yml
View file @
0af79383
...
...
@@ -21,14 +21,25 @@ jobs:
with
:
fetch-depth
:
0
ref
:
${{ github.event.pull_request.head.sha }}
-
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
-
name
:
Find the changed files
id
:
find-changed-files
uses
:
tj-actions/changed-files@v35
with
:
base_sha
:
${{ steps.locate-base-sha.outputs.baseSHA }}
files
:
|
op_builder/**
colossalai/kernel/**
setup.py
-
name
:
List changed files
run
:
|
for file in ${{ steps.find-changed-files.outputs.all_changed_files }}; do
...
...
.github/workflows/pre_commit.yml
View file @
0af79383
...
...
@@ -12,9 +12,23 @@ jobs:
fetch-depth
:
0
ref
:
${{ github.event.pull_request.head.sha }}
# the PR branch and the hpcaitech/colossal-ai main branch
# must share a common commit, we need to locate that commit,
# which is the commit checked-out or forked when the PR branch is created
# such that we can look for files changed since that commit
-
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
-
name
:
Find the changed files
id
:
find-changed-files
uses
:
tj-actions/changed-files@v35
with
:
base_sha
:
${{ steps.locate-base-sha.outputs.baseSHA }}
-
name
:
List all changed files
run
:
|
...
...
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