From 1be47e1b717c69a31decbef992181ba3e87915cf Mon Sep 17 00:00:00 2001 From: Sait Cakmak Date: Mon, 29 Apr 2024 16:59:00 -0700 Subject: [PATCH] Use codecov github action for uploading coverage (#2406) Summary: Replicates https://github.com/pytorch/botorch/pull/2312 Codecov bash uploader is marked for deprecation: https://docs.codecov.com/docs/about-the-codecov-bash-uploader Switching the CI to use the codecov github action with the newly added upload token: https://github.com/marketplace/actions/codecov Pull Request resolved: https://github.com/facebook/Ax/pull/2406 Test Plan: Check for successful upload in CI signals Reviewed By: dme65 Differential Revision: D56713216 Pulled By: saitcakmak fbshipit-source-id: c5d70e0d4a362e61788ed54b73605786bd5b4f08 --- .github/workflows/build-and-test.yml | 1 + .github/workflows/cron.yml | 2 ++ .github/workflows/cron_pinned.yml | 2 ++ .github/workflows/deploy.yml | 2 ++ .github/workflows/reusable_test.yml | 10 ++++++---- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 624cdab7d10..85c10202598 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -13,6 +13,7 @@ jobs: uses: ./.github/workflows/reusable_test.yml with: pinned_botorch: false + secrets: inherit lint: diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index c8fe85c579a..64dfc99e4ac 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -19,6 +19,7 @@ jobs: with: pinned_botorch: false minimal_dependencies: true + secrets: inherit tests-and-coverage-full: name: Tests with latest BoTorch & full dependencies @@ -26,6 +27,7 @@ jobs: with: pinned_botorch: false minimal_dependencies: false + secrets: inherit build-tutorials: name: Build tutorials with latest BoTorch diff --git a/.github/workflows/cron_pinned.yml b/.github/workflows/cron_pinned.yml index 63a6ea8d879..ac62b3640cf 100644 --- a/.github/workflows/cron_pinned.yml +++ b/.github/workflows/cron_pinned.yml @@ -12,6 +12,7 @@ jobs: with: pinned_botorch: true minimal_dependencies: true + secrets: inherit tests-and-coverage-full: name: Tests with pinned BoTorch & full dependencies @@ -19,6 +20,7 @@ jobs: with: pinned_botorch: true minimal_dependencies: false + secrets: inherit build-tutorials: name: Build tutorials with pinned BoTorch diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b499baa8334..a53c44efa63 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -13,12 +13,14 @@ jobs: uses: ./.github/workflows/reusable_test.yml with: pinned_botorch: false + secrets: inherit tests-and-coverage-pinned: name: Tests with pinned BoTorch uses: ./.github/workflows/reusable_test.yml with: pinned_botorch: true + secrets: inherit publish-stable-website: diff --git a/.github/workflows/reusable_test.yml b/.github/workflows/reusable_test.yml index 743ba964f8c..195f6068c6f 100644 --- a/.github/workflows/reusable_test.yml +++ b/.github/workflows/reusable_test.yml @@ -61,8 +61,10 @@ jobs: name: Tests and coverage run: | pytest -ra --cov=ax - - if: ${{ !inputs.minimal_dependencies }} - # Using same condition as above since we need the coverage report for upload. + - if: ${{ !inputs.minimal_dependencies && matrix.python-version == 3.10 }} + # Only upload codecov once per workflow. name: Upload coverage - run: | - bash <(curl -s https://codecov.io/bash) + uses: codecov/codecov-action@v4 + with: + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }}