Skip to content

Commit 5bbab15

Browse files
[ci] Fix example tests (#5714)
* [fix] revise timeout value on example CI * trivial
1 parent 121d7ad commit 5bbab15

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

.github/workflows/doc_test_on_pr.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
container:
5959
image: hpcaitech/pytorch-cuda:2.1.0-12.1.0
6060
options: --gpus all --rm
61-
timeout-minutes: 20
61+
timeout-minutes: 30
6262
defaults:
6363
run:
6464
shell: bash

.github/workflows/example_check_on_pr.yml

+24-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
# any change in the examples folder will trigger check for the corresponding example.
99
paths:
1010
- "examples/**"
11+
- "!examples/**.md"
1112

1213
jobs:
1314
# This is for changed example files detect and output a matrix containing all the corresponding directory name.
@@ -19,6 +20,7 @@ jobs:
1920
outputs:
2021
matrix: ${{ steps.setup-matrix.outputs.matrix }}
2122
anyChanged: ${{ steps.setup-matrix.outputs.anyChanged }}
23+
anyExtensionFileChanged: ${{ steps.find-extension-change.outputs.any_changed }}
2224
name: Detect changed example files
2325
concurrency:
2426
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-detect-change
@@ -37,6 +39,16 @@ jobs:
3739
echo $commonCommit
3840
echo "baseSHA=$commonCommit" >> $GITHUB_OUTPUT
3941
42+
- name: Find the changed extension-related files
43+
id: find-extension-change
44+
uses: tj-actions/changed-files@v35
45+
with:
46+
base_sha: ${{ steps.locate-base-sha.outputs.baseSHA }}
47+
files: |
48+
op_builder/**
49+
colossalai/kernel/**
50+
setup.py
51+
4052
- name: Get all changed example files
4153
id: changed-files
4254
uses: tj-actions/changed-files@v35
@@ -79,17 +91,28 @@ jobs:
7991
container:
8092
image: hpcaitech/pytorch-cuda:2.1.0-12.1.0
8193
options: --gpus all --rm -v /data/scratch/examples-data:/data/ -v /dev/shm
82-
timeout-minutes: 20
94+
timeout-minutes: 30
8395
concurrency:
8496
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-run-example-${{ matrix.directory }}
8597
cancel-in-progress: true
8698
steps:
8799
- uses: actions/checkout@v3
88100

101+
- name: Restore Colossal-AI Cache
102+
if: needs.detect.outputs.anyExtensionFileChanged != 'true'
103+
run: |
104+
if [ -d /github/home/cuda_ext_cache ] && [ ! -z "$(ls -A /github/home/cuda_ext_cache/)" ]; then
105+
cp -p -r /github/home/cuda_ext_cache/* /__w/ColossalAI/ColossalAI/
106+
fi
107+
89108
- name: Install Colossal-AI
90109
run: |
91110
BUILD_EXT=1 pip install -v .
92111
112+
- name: Store Colossal-AI Cache
113+
run: |
114+
cp -p -r /__w/ColossalAI/ColossalAI/build /github/home/cuda_ext_cache/
115+
93116
- name: Test the example
94117
run: |
95118
example_dir=${{ matrix.directory }}

.github/workflows/example_check_on_schedule.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
container:
3737
image: hpcaitech/pytorch-cuda:2.1.0-12.1.0
3838
options: --gpus all --rm -v /data/scratch/examples-data:/data/ -v /dev/shm
39-
timeout-minutes: 10
39+
timeout-minutes: 30
4040
steps:
4141
- name: 📚 Checkout
4242
uses: actions/checkout@v3

0 commit comments

Comments
 (0)