-
Notifications
You must be signed in to change notification settings - Fork 11
81 lines (68 loc) · 2.57 KB
/
codecov.yml
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
79
80
81
name: codecov
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
run: |
pip install wheel setuptools
pip install tensorflow==2.8.0
pip install "protobuf<=3.20" --force-reinstall
- name: Build wheel
run: python setup.py bdist_wheel
- name: Upload Python wheel
uses: actions/upload-artifact@v3
with:
name: Python wheel
path: ${{github.workspace}}/dist/gradient_accumulator-*.whl
if-no-files-found: error
codecov:
needs: build
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
pip install wheel setuptools flake8 pytest-cov
pip install tensorflow==2.8.0 "tensorflow-datasets<=4.8.2"
pip install "protobuf<=3.20" --force-reinstall
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: "Python wheel"
- name: Install wheel
run: pip install --find-links=${{github.workspace}} gradient_accumulator
- name: Test library accessibility
run: python -c "from gradient_accumulator import GradientAccumulateModel, GradientAccumulateOptimizer"
- name: Run tests and collect coverage
run: |
pytest --cov=gradient_accumulator tests/test_optimizer_wrapper.py \
--cov=gradient_accumulator tests/test_mixed_precision.py \
--cov=gradient_accumulator tests/test_adaptive_gradient_clipping.py \
--cov=gradient_accumulator tests/test_sparse_optimizer.py \
--cov=gradient_accumulator tests/test_expected_result.py \
--cov=gradient_accumulator tests/test_mp_batch_norm.py \
--cov=gradient_accumulator tests/test_bn_convnd.py \
--cov=gradient_accumulator tests/test_bn_pretrained_swap.py \
--cov=gradient_accumulator tests/test_model_distribute.py \
--cov=gradient_accumulator tests/test_optimizer.py
- name: Lint with flake8
run: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1