Skip to content

Commit 600db09

Browse files
authored
[actions] split formatting and unit tests into two jobs (deepspeedai#1339)
1 parent 74f058b commit 600db09

2 files changed

Lines changed: 38 additions & 16 deletions

File tree

.github/workflows/formatting.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Formatting
2+
3+
on:
4+
push:
5+
branches:
6+
'staging**'
7+
pull_request:
8+
branches:
9+
'**'
10+
11+
jobs:
12+
13+
# formatting and basic install on cpu-only machine
14+
formatting:
15+
runs-on: ubuntu-20.04
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
20+
- name: environment
21+
run: |
22+
which python
23+
python --version
24+
pip install torch==1.9.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
25+
python -c "import torch; print('torch:', torch.__version__, torch)"
26+
27+
- name: Install deepspeed
28+
run: |
29+
pip install .[dev]
30+
ds_report
31+
32+
- name: Formatting checks
33+
run: |
34+
pre-commit run --all-files

.github/workflows/main.yml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,23 @@
1-
# This is a basic workflow to help you get started with Actions
2-
31
name: Build
42

5-
# Controls when the action will run.
63
on:
74
push:
5+
branches:
6+
'staging**'
87
paths-ignore:
98
- 'docs/**'
109
pull_request:
1110
paths-ignore:
1211
- 'docs/**'
1312

14-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1513
jobs:
16-
# This workflow contains a single job called "build"
17-
build:
18-
# The type of runner that the job will run on
14+
# unit tests running on nvidia gpus
15+
unit-tests:
1916
runs-on: [self-hosted, nvidia]
2017

21-
# Steps represent a sequence of tasks that will be executed as part of the job
2218
steps:
23-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
2419
- uses: actions/checkout@v2
2520

26-
# Runs a single command using the runners shell
2721
- name: environment
2822
run: |
2923
nvidia-smi
@@ -34,17 +28,11 @@ jobs:
3428
python -c "import torch; print('torch:', torch.__version__, torch)"
3529
python -c "import torch; print('CUDA available:', torch.cuda.is_available())"
3630
37-
# Runs a set of commands using the runners shell
3831
- name: Install deepspeed
3932
run: |
4033
pip install .[dev]
4134
ds_report
4235
43-
- name: Formatting checks
44-
run: |
45-
pre-commit run --all-files
46-
47-
# Runs a set of commands using the runners shell
4836
- name: Unit tests
4937
run: |
5038
if [[ -d ./torch-extensions ]]; then rm -rf ./torch-extensions; fi

0 commit comments

Comments
 (0)