Skip to content

Commit ea4cb95

Browse files
HuanyuZhangfacebook-github-bot
authored andcommitted
Fix broken coveralls (#713)
Summary: Pull Request resolved: #713 Fix the broken communication between CI and coveralls Reviewed By: EnayatUllah Differential Revision: D68002443 fbshipit-source-id: ee81fbdb57b059a1aad15b0c0d190a0eda6354f2
1 parent 3e97447 commit ea4cb95

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

.github/workflows/ci_cpu.yml

+25-3
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,21 @@ jobs:
5252
- name: Run unit tests
5353
run: |
5454
mkdir unittest-py38-release-reports
55-
coverage run -m pytest --doctest-modules -p conftest --junitxml=unittest-py38-release-reports/junit.xml opacus
55+
coverage run -m pytest --doctest-modules -p conftest opacus
5656
coverage report -i -m
57+
# Format into xml to be used for coveralls
58+
coverage xml -i
5759
- name: Store test results
5860
uses: actions/upload-artifact@v4
5961
with:
6062
name: unittest-py38-release-reports
6163
path: unittest-py38-release-reports
64+
- name: Send coverage to Coveralls (parallel)
65+
uses: coverallsapp/github-action@v2
66+
with:
67+
format: cobertura
68+
parallel: true
69+
flag-name: run-1
6270

6371
unittest_py39_torch_release:
6472
runs-on: ubuntu-latest
@@ -77,13 +85,19 @@ jobs:
7785
- name: Run unit tests
7886
run: |
7987
mkdir unittest-py39-release-reports
80-
coverage run -m pytest --doctest-modules -p conftest --junitxml=unittest-py39-release-reports/junit.xml opacus
81-
coverage report -i -m
88+
coverage run -m pytest --doctest-modules -p conftest opacus
89+
coverage xml -i
8290
- name: Store test results
8391
uses: actions/upload-artifact@v4
8492
with:
8593
name: unittest-py39-release-reports
8694
path: unittest-py39-release-reports
95+
- name: Send coverage to Coveralls (parallel)
96+
uses: coverallsapp/github-action@v2
97+
with:
98+
format: cobertura
99+
parallel: true
100+
flag-name: run-2
87101

88102
prv_accountant_values:
89103
runs-on: ubuntu-latest
@@ -150,11 +164,18 @@ jobs:
150164
coverage run examples/mnist.py --lr 0.25 --sigma 0.7 -c 1.5 --batch-size 64 --epochs 1 --data-root runs/mnist/data --n-runs 1 --device cpu
151165
python -c "import torch; accuracy = torch.load('run_results_mnist_0.25_0.7_1.5_64_1.pt'); exit(0) if (accuracy[0]>0.78 and accuracy[0]<0.95) else exit(1)"
152166
coverage report -i -m
167+
coverage xml -i
153168
- name: Store test results
154169
uses: actions/upload-artifact@v4
155170
with:
156171
name: mnist-cpu-reports
157172
path: runs/mnist/test-reports
173+
- name: Send coverage to Coveralls (parallel)
174+
uses: coverallsapp/github-action@v2
175+
with:
176+
format: cobertura
177+
parallel: true
178+
flag-name: run-3
158179

159180
######## FINISH COVERALLS ##########
160181
finish_coveralls_parallel:
@@ -168,3 +189,4 @@ jobs:
168189
with:
169190
github_token: ${{ secrets.GITHUB_TOKEN }}
170191
parallel-finished: true
192+
carryforward: "run-1,run-2,run-3"

0 commit comments

Comments
 (0)