Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken coveralls #713

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix broken coveralls (#713)
Summary:

Fix the broken communication between CI and coveralls

Differential Revision: D68002443
HuanyuZhang authored and facebook-github-bot committed Jan 17, 2025
commit 7b0211abd2672c757b5ea2e08dadb57a04b857c5
28 changes: 25 additions & 3 deletions .github/workflows/ci_cpu.yml
Original file line number Diff line number Diff line change
@@ -52,13 +52,21 @@ jobs:
- name: Run unit tests
run: |
mkdir unittest-py38-release-reports
coverage run -m pytest --doctest-modules -p conftest --junitxml=unittest-py38-release-reports/junit.xml opacus
coverage run -m pytest --doctest-modules -p conftest opacus
coverage report -i -m
# Format into xml to be used for coveralls
coverage xml -i
- name: Store test results
uses: actions/upload-artifact@v4
with:
name: unittest-py38-release-reports
path: unittest-py38-release-reports
- name: Send coverage to Coveralls (parallel)
uses: coverallsapp/github-action@v2
with:
format: cobertura
parallel: true
flag-name: run-1

unittest_py39_torch_release:
runs-on: ubuntu-latest
@@ -77,13 +85,19 @@ jobs:
- name: Run unit tests
run: |
mkdir unittest-py39-release-reports
coverage run -m pytest --doctest-modules -p conftest --junitxml=unittest-py39-release-reports/junit.xml opacus
coverage report -i -m
coverage run -m pytest --doctest-modules -p conftest opacus
coverage xml -i
- name: Store test results
uses: actions/upload-artifact@v4
with:
name: unittest-py39-release-reports
path: unittest-py39-release-reports
- name: Send coverage to Coveralls (parallel)
uses: coverallsapp/github-action@v2
with:
format: cobertura
parallel: true
flag-name: run-2

prv_accountant_values:
runs-on: ubuntu-latest
@@ -150,11 +164,18 @@ jobs:
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
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)"
coverage report -i -m
coverage xml -i
- name: Store test results
uses: actions/upload-artifact@v4
with:
name: mnist-cpu-reports
path: runs/mnist/test-reports
- name: Send coverage to Coveralls (parallel)
uses: coverallsapp/github-action@v2
with:
format: cobertura
parallel: true
flag-name: run-3

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