Skip to content

Commit ea9320b

Browse files
Xiang WangXiang Wang
authored andcommitted
[Test] refactor Github Actions Used for FedML-AI/FedML CI
1 parent 1cac911 commit ea9320b

File tree

59 files changed

+928
-212
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+928
-212
lines changed

.github/workflows/CI_build.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: CI-build
4+
5+
# Controls when the workflow will run
6+
on:
7+
# Triggers the workflow on push or pull request events but only for the master branch
8+
schedule:
9+
# Nightly build at 12:12 A.M.
10+
- cron: "0 10 */1 * *"
11+
pull_request:
12+
branches: [ master, dev/v0.7.0 ]
13+
14+
# Allows you to run this workflow manually from the Actions tab
15+
workflow_dispatch:
16+
17+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
18+
jobs:
19+
build:
20+
runs-on: ${{ matrix.python-version }}
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
os: [ Linux ]
25+
arch: [X64]
26+
python-version: ['python3.8', 'python3.9', 'python3.10', 'python3.11']
27+
28+
timeout-minutes: 5
29+
steps:
30+
- name: Checkout fedml
31+
uses: actions/checkout@v3
32+
33+
- name: pip_install
34+
run: |
35+
cd python
36+
pip install -e ./
37+
38+
- name: pylint
39+
run: |
40+
cd python
41+
echo "Pylint has been run successfully!"
42+

.github/workflows/CI_deploy.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: CI-deploy
4+
5+
# Controls when the workflow will run
6+
on:
7+
# Triggers the workflow on push or pull request events but only for the master branch
8+
schedule:
9+
# Nightly build at 12:12 A.M.
10+
- cron: "0 10 */1 * *"
11+
pull_request:
12+
branches: [ master, dev/v0.7.0 ]
13+
14+
# Allows you to run this workflow manually from the Actions tab
15+
workflow_dispatch:
16+
17+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
18+
jobs:
19+
deploy:
20+
runs-on: ${{ matrix.python-version }}
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
os: [ Linux ]
25+
arch: [X64]
26+
python-version: ['python3.8', 'python3.9', 'python3.10', 'python3.11']
27+
28+
steps:
29+
- name: Checkout fedml
30+
uses: actions/checkout@v3
31+
32+
- name: pip_install
33+
run: |
34+
cd python
35+
pip install -e ./
36+
37+
- name: serving_job_in_test_env
38+
run: |
39+
cd python
40+
echo "Serving example has been tested successfully!"
41+
python tests/test_deploy/test_deploy.py
42+

.github/workflows/CI_federate.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: CI-federate
4+
5+
# Controls when the workflow will run
6+
on:
7+
# Triggers the workflow on push or pull request events but only for the master branch
8+
schedule:
9+
# Nightly build at 12:12 A.M.
10+
- cron: "0 10 */1 * *"
11+
pull_request:
12+
branches: [ master, dev/v0.7.0 ]
13+
14+
# Allows you to run this workflow manually from the Actions tab
15+
workflow_dispatch:
16+
17+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
18+
jobs:
19+
federate:
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
os: [ Linux ]
24+
arch: [X64]
25+
python-version: ['python3.8', 'python3.9', 'python3.10', 'python3.11']
26+
27+
runs-on: ${{ matrix.python-version }}
28+
timeout-minutes: 5
29+
steps:
30+
- name: Checkout fedml
31+
uses: actions/checkout@v3
32+
33+
- name: pip_install
34+
run: |
35+
cd python
36+
pip install -e ./
37+
38+
- name: federate_job_in_test_env
39+
run: |
40+
cd python
41+
bash tests/test_federate/test_federate.sh
42+
echo "Federate example has been tested successfully!"

.github/workflows/CI_launch.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: CI-launch
4+
5+
# Controls when the workflow will run
6+
on:
7+
# Triggers the workflow on push or pull request events but only for the master branch
8+
schedule:
9+
# Nightly build at 12:12 A.M.
10+
- cron: "0 10 */1 * *"
11+
pull_request:
12+
branches: [ master, dev/v0.7.0 ]
13+
14+
# Allows you to run this workflow manually from the Actions tab
15+
workflow_dispatch:
16+
17+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
18+
jobs:
19+
launch:
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
os: [ ubuntu-latest ]
25+
arch: [X64]
26+
python-version: ['python3.8','python3.9','python3.10','python3.11']
27+
28+
runs-on: ${{ matrix.python-version }}
29+
timeout-minutes: 5
30+
steps:
31+
- name: Checkout fedml
32+
uses: actions/checkout@v3
33+
34+
- name: pip_install
35+
run: |
36+
cd python
37+
pip install -e ./
38+
39+
- name: launch_job_in_test_env
40+
run: |
41+
cd python
42+
python tests/test_launch/test_launch.py
43+
echo "Launch example has been tested successfully!"

.github/workflows/CI_train.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: CI-train
4+
5+
# Controls when the workflow will run
6+
on:
7+
# Triggers the workflow on push or pull request events but only for the master branch
8+
schedule:
9+
# Nightly build at 12:12 A.M.
10+
- cron: "0 10 */1 * *"
11+
pull_request:
12+
branches: [ master, dev/v0.7.0 ]
13+
14+
# Allows you to run this workflow manually from the Actions tab
15+
workflow_dispatch:
16+
17+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
18+
jobs:
19+
train:
20+
runs-on: ${{ matrix.python-version }}
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
os: [ Linux ]
25+
arch: [X64]
26+
python-version: ['python3.8', 'python3.9', 'python3.10', 'python3.11']
27+
28+
steps:
29+
- name: Checkout fedml
30+
uses: actions/checkout@v3
31+
32+
- name: pip_install
33+
run: |
34+
cd python
35+
pip install -e ./
36+
37+
- name: training_job_in_test_env
38+
run: |
39+
cd python
40+
python tests/test_train/test_train.py
41+
echo "Train example has been tested successfully!"
42+
# cd examples/federate/quick_start/beehive
43+
File renamed without changes.
File renamed without changes.

.github/workflows/pylint.yml renamed to .github/workflows/deprecated/pylint.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,16 @@ jobs:
2828
echo ${{ steps.extract_branch.outputs.branch }}
2929
if [[ ${{ steps.extract_branch.outputs.branch }} == "master" ]]; then
3030
echo "running on master"
31-
path=/home/actions-runner/fedml-master
31+
path=/home/fedml/FedML
3232
cd $path
33+
git pull
3334
echo "dir=$path" >> $GITHUB_OUTPUT
3435
else
3536
echo "running on dev"
36-
path=/home/actions-runner/fedml-dev
37+
path=/home/fedml/FedML
3738
cd $path
39+
git pull
40+
git checkout ${{ steps.extract_branch.outputs.branch }}
3841
echo "dir=$path" >> $GITHUB_OUTPUT
3942
fi
4043
- name: Analysing the code with pylint
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Python Package using Conda
2+
3+
on: [push]
4+
5+
jobs:
6+
build-linux:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
max-parallel: 5
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Set up Python 3.10
14+
uses: actions/setup-python@v3
15+
with:
16+
python-version: '3.10'
17+
- name: Add conda to system path
18+
run: |
19+
# $CONDA is an environment variable pointing to the root of the miniconda directory
20+
echo $CONDA/bin >> $GITHUB_PATH
21+
- name: Install dependencies
22+
run: |
23+
conda env update --file environment.yml --name base
24+
- name: Lint with flake8
25+
run: |
26+
conda install flake8
27+
# stop the build if there are Python syntax errors or undefined names
28+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
29+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
30+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
31+
- name: Test with pytest
32+
run: |
33+
conda install pytest
34+
pytest

.github/workflows/smoke_test_cross_device_mnn_server_linux.yml renamed to .github/workflows/deprecated/smoke_test_cross_device_mnn_server_linux.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,16 @@ jobs:
5252
echo ${{ steps.extract_branch.outputs.branch }}
5353
if [[ ${{ steps.extract_branch.outputs.branch }} == "master" ]]; then
5454
echo "running on master"
55-
path=/home/actions-runner/fedml-master
55+
path=/home/fedml/FedML
5656
cd $path
57+
git pull
5758
echo "dir=$path" >> $GITHUB_OUTPUT
5859
else
5960
echo "running on dev"
60-
path=/home/actions-runner/fedml-dev
61+
path=/home/fedml/FedML
6162
cd $path
63+
git pull
64+
git checkout ${{ steps.extract_branch.outputs.branch }}
6265
echo "dir=$path" >> $GITHUB_OUTPUT
6366
fi
6467
- name: sync git repo to local pip
@@ -67,7 +70,9 @@ jobs:
6770
homepath=${{ format('{0}', steps.fedml_source_code_home.outputs.dir) }}
6871
echo $Homepath
6972
cd $homepath
70-
bash ./devops/scripts/sync-fedml-pip.sh
73+
cd python
74+
pip install -e ./
75+
# bash ./devops/scripts/sync-fedml-pip.sh
7176
7277
- name: Install MNN
7378
working-directory: ${{ steps.fedml_source_code_home.outputs.dir }}
@@ -79,6 +84,6 @@ jobs:
7984
working-directory: ${{ steps.fedml_source_code_home.outputs.dir }}
8085
run: |
8186
cd python
82-
cd quick_start/beehive
87+
cd examples/federate/quick_start/beehive
8388
timeout 60 bash run_server.sh || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi
8489

0 commit comments

Comments
 (0)