-
Notifications
You must be signed in to change notification settings - Fork 80
78 lines (73 loc) · 2.94 KB
/
Copy pathtest.yaml
File metadata and controls
78 lines (73 loc) · 2.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build_and_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest-cov==2.6.1 coverage -r requirements-test.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 adaptdl cli ray cli/bin/adaptdl sched --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 adaptdl cli ray cli/bin/adaptdl sched --exclude cli/adaptdl_cli/__init__.py
- name: Build and install train package
run: |
pip install -e ./adaptdl
- name: Build and install sched package
run: |
pip install -e ./sched
- name: Build and install adaptdl_ray package
run: |
pip install -e ./ray
- name: Build and install CLI package
run: |
pip install -e ./cli
- name: Test sched
run: |
pytest sched -xv --cov=sched --cov-branch --cov-report=
mv .coverage .coverage.sched
- name: Test train
run: |
pytest adaptdl -xv --cov=adaptdl --cov-branch --cov-report=
mv .coverage .coverage.train
- name: Test ray
run: |
MOCK=true pytest ray/adaptdl_ray/aws/test_worker.py --cov=ray/adaptdl --cov-branch --cov-report=
mv .coverage .coverage.ray_aws.worker
pytest ray/adaptdl_ray/aws/test_controller.py --cov=ray/adaptdl --cov-branch --cov-report=
mv .coverage .coverage.ray_aws.controller
pytest ray/adaptdl_ray/aws/test_controller_mocked_ray.py --cov=ray/adaptdl --cov-branch --cov-report=
mv .coverage .coverage.ray_aws.controller_mocked
pytest ray/adaptdl_ray/tests --cov=ray/adaptdl --cov-branch --cov-report=
mv .coverage .coverage.ray.tests
pytest ray/adaptdl_ray/tune --cov=ray/adaptdl --cov-branch --cov-report=
mv .coverage .coverage.ray.tune
pytest ray/adaptdl_ray/adaptdl --cov=ray/adaptdl --cov-branch --cov-report=
mv .coverage .coverage.ray.adaptdl
- name: Coverage
run: |
coverage combine
coverage report -m --omit="**/*test.py"
coverage html --omit="**/*test.py"
coverage xml --omit="**/*test.py" -o htmlcov/coverage.xml
- name: Upload to CodeCov
uses: codecov/codecov-action@v1
with:
file: htmlcov/coverage.xml
name: adaptdl
fail_ci_if_error: true # optional (default = false)