From 88058e57e8e2681cff20d93c9aa8206d2431cb46 Mon Sep 17 00:00:00 2001 From: Sankalp Sanand Date: Wed, 7 Feb 2024 08:31:10 -0500 Subject: [PATCH] Fixing the github workflows (#1927) * fixing if condition * fixing if condition * now added release as part of nightly tests * updated changelog --- .github/workflows/man_0_assign_version.yml | 9 +- .github/workflows/man_1_push_to_master.yml | 9 +- .github/workflows/man_2_create_prerelease.yml | 11 ++- .github/workflows/nightly-tests.yml | 26 +++++- .github/workflows/tests.yml | 88 +++++++------------ CHANGELOG.md | 2 + 6 files changed, 84 insertions(+), 61 deletions(-) diff --git a/.github/workflows/man_0_assign_version.yml b/.github/workflows/man_0_assign_version.yml index b9ce3d410..8863caf16 100644 --- a/.github/workflows/man_0_assign_version.yml +++ b/.github/workflows/man_0_assign_version.yml @@ -26,6 +26,13 @@ on: description: "WARNING: Make sure the `nightly-tests` or the most recent `tests` workflow has passed successfully in develop before running this workflow. Uncheck this box if it has." + workflow_call: + inputs: + nightly_tests_failed: + type: boolean + required: true + default: false + permissions: id-token: write contents: read @@ -40,6 +47,6 @@ jobs: needs: - license if: > - !github.event.inputs.nightly_tests_failed + !inputs.nightly_tests_failed uses: ./.github/workflows/changelog.yml secrets: inherit # pragma: allowlist secret diff --git a/.github/workflows/man_1_push_to_master.yml b/.github/workflows/man_1_push_to_master.yml index efe6d4db4..80db54dc3 100644 --- a/.github/workflows/man_1_push_to_master.yml +++ b/.github/workflows/man_1_push_to_master.yml @@ -26,6 +26,13 @@ on: description: "WARNING: Make sure the `man_0_assign_version` workflow has passed successfully before running this workflow. Uncheck this box if it has." + workflow_call: + inputs: + assign_version_failed: + type: boolean + required: true + default: false + permissions: id-token: write contents: read @@ -55,7 +62,7 @@ jobs: - name: Perform the push to master if develop is ahead id: push if: > - !github.event.inputs.assign_version_failed + !inputs.assign_version_failed run: | DEVELOP_VERSION="${{ steps.get-versions.outputs.develop_version }}" MASTER_VERSION="${{ steps.get-versions.outputs.master_version }}" diff --git a/.github/workflows/man_2_create_prerelease.yml b/.github/workflows/man_2_create_prerelease.yml index e982b8b37..c6c214870 100644 --- a/.github/workflows/man_2_create_prerelease.yml +++ b/.github/workflows/man_2_create_prerelease.yml @@ -26,6 +26,13 @@ on: description: "WARNING: Make sure the `man_1_push_to_master` workflow has passed successfully before running this workflow. Uncheck this box if it has." + workflow_call: + inputs: + push_to_master_failed: + type: boolean + required: true + default: false + permissions: id-token: write contents: read @@ -35,7 +42,7 @@ jobs: name: Create a Prerelease uses: ./.github/workflows/release.yml if: > - !github.event.inputs.push_to_master_failed + !inputs.push_to_master_failed with: prerelease: true secrets: inherit # pragma: allowlist secret @@ -49,7 +56,7 @@ jobs: - name: Checkout master uses: actions/checkout@v4 with: - ref: ${{ github.event.inputs.branch_name }} + ref: ${{ inputs.branch_name }} - name: Format Slack message run: | diff --git a/.github/workflows/nightly-tests.yml b/.github/workflows/nightly-tests.yml index da7becdf1..85d507218 100644 --- a/.github/workflows/nightly-tests.yml +++ b/.github/workflows/nightly-tests.yml @@ -17,9 +17,6 @@ name: nightly-tests on: - push: - branches: - - develop schedule: - cron: "0 0 * * *" @@ -36,5 +33,28 @@ jobs: tests: name: Unit and Functional Tests + needs: + - license uses: ./.github/workflows/tests.yml secrets: inherit # pragma: allowlist secret + + assign_version: + name: Assign Version + needs: + - tests + uses: ./.github/workflows/assign_version.yml + secrets: inherit # pragma: allowlist secret + + push_to_master: + name: Push to Master + needs: + - assign_version + uses: ./.github/workflows/push_to_master.yml + secrets: inherit # pragma: allowlist secret + + create_prerelease: + name: Create a Prerelease + needs: + - push_to_master + uses: ./.github/workflows/create_prerelease.yml + secrets: inherit # pragma: allowlist secret diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b66ce1ebb..58189ba96 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -308,89 +308,69 @@ jobs: - name: Dump Covalent logs run: covalent logs - - name: Upload SDK report to Codecov with retry + - name: Upload SDK report to Codecov id: upload-sdk-report if: > env.RECOMMENDED_PLATFORM && (github.event_name == 'workflow_call' || steps.sdk-coverage.outcome == 'success') - uses: Wandalen/wretry.action@master + uses: codecov/codecov-action@v3 with: - action: codecov/codecov-action@v3 - with: | - files: ./sdk_coverage.xml - flags: SDK - name: "SDK Unit Tests" - fail_ci_if_error: true - attempt_limit: 5 - attempt_delay: 5000 - - - name: Upload Dispatcher report to Codecov with retry + files: ./sdk_coverage.xml + flags: SDK + name: "SDK Unit Tests" + fail_ci_if_error: true + + - name: Upload Dispatcher report to Codecov id: upload-dispatcher-report if: > env.RECOMMENDED_PLATFORM && (github.event_name == 'workflow_call' || steps.dispatcher-coverage.outcome == 'success') - uses: Wandalen/wretry.action@master + uses: codecov/codecov-action@v3 with: - action: codecov/codecov-action@v3 - with: | - files: ./dispatcher_coverage.xml - flags: Dispatcher - name: "Dispatcher Unit Tests" - fail_ci_if_error: true - attempt_limit: 5 - attempt_delay: 5000 - - - name: Upload Functional report to Codecov with retry + files: ./dispatcher_coverage.xml + flags: Dispatcher + name: "Dispatcher Unit Tests" + fail_ci_if_error: true + + - name: Upload Functional report to Codecov id: upload-functional-report if: > env.RECOMMENDED_PLATFORM && steps.functional-coverage.outcome == 'success' - uses: Wandalen/wretry.action@master + uses: codecov/codecov-action@v3 with: - action: codecov/codecov-action@v3 - with: | - files: ./functional_tests_coverage.xml - flags: Functional_Tests - name: "Functional Tests" - fail_ci_if_error: true - attempt_limit: 5 - attempt_delay: 5000 - - - name: Upload UI backend report to Codecov with retry + files: ./functional_tests_coverage.xml + flags: Functional_Tests + name: "Functional Tests" + fail_ci_if_error: true + + - name: Upload UI backend report to Codecov id: upload-ui-backend-report if: > env.RECOMMENDED_PLATFORM && (github.event_name == 'workflow_call' || steps.ui-backend-coverage.outcome == 'success') - uses: Wandalen/wretry.action@master + uses: codecov/codecov-action@v3 with: - action: codecov/codecov-action@v3 - with: | - files: ./ui_backend_coverage.xml - flags: UI_Backend - name: "UI Backend Unit Tests" - fail_ci_if_error: true - attempt_limit: 5 - attempt_delay: 5000 - - - name: Upload UI frontend report to Codecov with retry + files: ./ui_backend_coverage.xml + flags: UI_Backend + name: "UI Backend Unit Tests" + fail_ci_if_error: true + + - name: Upload UI frontend report to Codecov id: upload-ui-frontend-report if: > env.RECOMMENDED_PLATFORM && (github.event_name == 'workflow_call' || steps.ui-frontend-tests.outcome == 'success') - uses: Wandalen/wretry.action@master + uses: codecov/codecov-action@v3 with: - action: codecov/codecov-action@v3 - with: | - files: ./covalent_ui/webapp/coverage/clover.xml - flags: UI_Frontend - name: "UI Frontend Unit Tests" - fail_ci_if_error: true - attempt_limit: 5 - attempt_delay: 5000 + files: ./covalent_ui/webapp/coverage/clover.xml + flags: UI_Frontend + name: "UI Frontend Unit Tests" + fail_ci_if_error: true - name: Local Codecov id: local-codecov diff --git a/CHANGELOG.md b/CHANGELOG.md index ce526d4da..9f0c12d99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Removed `conda` releases from `release.yml`. - When pushing to `master`, now the version numbers of `develop` and `master` will be compared in `man_1_push_to_master`. - Upgraded checkout action to v4 in `release.yml`. +- Fixing the if condition for the manual workflows. +- Added pre-release creation as part of `nightly-tests` workflow. ### Added