diff --git a/.github/workflows/ecosystem-submission.yml b/.github/workflows/ecosystem-submission.yml index 24e9377cd5..b444f54efd 100644 --- a/.github/workflows/ecosystem-submission.yml +++ b/.github/workflows/ecosystem-submission.yml @@ -69,27 +69,31 @@ jobs: tier: ${{ env.tier }} logs_link: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} - # Check result, update issue and create MR + # Check result, update issue and create PR - name: Check return id: check-return run: | - echo "PASS_LOG=True" >> "$GITHUB_OUTPUT" - - declare -a return_list=( \ - "${{ steps.stable.outputs.result }}" \ - "${{ steps.standard.outputs.result }}" \ - "${{ steps.dev.outputs.result }}" \ - ) - for i in "${return_list[@]}"; do - if [[ "${i}" != *"True"* ]]; then - echo "PASS_LOG=False" >> "$GITHUB_OUTPUT" - fi - done - - - name: Check the check - id: check-result - run: | - echo "Pass log is ${{ steps.check-return.outputs.PASS_LOG }}" + if [[ "${{ steps.standard.outputs.result }}" == *"True"* ]]; then + echo "::notice title=StandardCheck::Success" + echo "PASS_STD=True" >> "$GITHUB_OUTPUT" + else + echo "::error title=StandardCheck::Didn't pass" + echo "PASS_STD=False" >> "$GITHUB_OUTPUT" + fi + if [[ "${{ steps.stable.outputs.result }}" == *"True"* ]]; then + echo "::notice title=StableCheck::Success" + echo "PASS_STB=True" >> "$GITHUB_OUTPUT" + else + echo "::warning title=StableCheck::Didn't pass" + echo "PASS_STB=False" >> "$GITHUB_OUTPUT" + fi + if [[ "${{ steps.dev.outputs.result }}" == *"True"* ]]; then + echo "::notice title=DevCheck::Success" + echo "PASS_DEV=True" >> "$GITHUB_OUTPUT" + else + echo "::warning title=DevCheck::Didn't pass" + echo "PASS_DEV=False" >> "$GITHUB_OUTPUT" + fi - name: Add member env: @@ -125,8 +129,8 @@ jobs: branch: submission-${{ github.event.issue.number }} base: main - - name: Create comment on success - if: ${{ steps.check-return.outputs.PASS_LOG == 'True' }} + - name: Create comment on success for standard check + if: ${{ steps.check-return.outputs.PASS_STD == 'True' }} uses: peter-evans/create-or-update-comment@v3 with: issue-number: ${{ github.event.issue.number }} @@ -134,7 +138,7 @@ jobs: Successfull submission! :sparkles: PR #${{ steps.cpr.outputs.pull-request-number }} - name: Create comment on failure - if: ${{ steps.check-return.outputs.PASS_LOG == 'False' }} + if: ${{ steps.check-return.outputs.PASS_STD != 'True' }} uses: peter-evans/create-or-update-comment@v3 with: issue-number: ${{ github.event.issue.number }} @@ -143,3 +147,41 @@ jobs: See logs: https://github.com/qiskit-community/ecosystem/actions/runs/${{ github.run_id }} Please follow minimal requirements for project or/and add `ecosystem.json` configuration in the root of the project Read more here https://github.com/qiskit-community/ecosystem/blob/main/docs/project_overview.md#adding-project-to-the-ecosystem + + - name: Create comment on success for stable check + if: ${{ steps.check-return.outputs.PASS_STB == 'True' }} + uses: peter-evans/create-or-update-comment@v3 + with: + issue-number: ${{ github.event.issue.number }} + body: | + Tests with latest version of Qiskit release passed! :sparkles: + + - name: Create comment on failure for stable check + if: ${{ steps.check-return.outputs.PASS_STB != 'True' }} + uses: peter-evans/create-or-update-comment@v3 + with: + issue-number: ${{ github.event.issue.number }} + body: | + Tests with latest version of Qiskit release failed! :warning: + This means your project doesn't work with the latest version of Qiskit. + This is purely informational and doesn't affect your project joining the Ecosystem, but you may want to investigate the problem. + See logs: https://github.com/qiskit-community/ecosystem/actions/runs/${{ github.run_id }} + + - name: Create comment on success for dev check + if: ${{ steps.check-return.outputs.PASS_DEV == 'True' }} + uses: peter-evans/create-or-update-comment@v3 + with: + issue-number: ${{ github.event.issue.number }} + body: | + Tests with development version of Qiskit release passed! :sparkles: + + - name: Create comment on failure for dev check + if: ${{ steps.check-return.outputs.PASS_DEV != 'True' }} + uses: peter-evans/create-or-update-comment@v3 + with: + issue-number: ${{ github.event.issue.number }} + body: | + Tests with development version of Qiskit release failed! :warning: + This means your project might not work with the next version of Qiskit. + This is purely informational and doesn't affect your project joining Ecosystem. + See logs: https://github.com/qiskit-community/ecosystem/actions/runs/${{ github.run_id }} diff --git a/ecosystem/manager.py b/ecosystem/manager.py index bfdc41e395..e10a474419 100644 --- a/ecosystem/manager.py +++ b/ecosystem/manager.py @@ -131,7 +131,10 @@ def update_badges(self): for tier in Tier.all(): for project in self.dao.get_repos_by_tier(tier): - tests_passed = all(result.passed for result in project.tests_results) + tests_passed = True + for type_test in project.tests_results: + if type_test.test_type == "standard" and not type_test.passed: + tests_passed = False color = "blueviolet" if tests_passed else "gray" label = project.name message = tier diff --git a/tests/test_manager.py b/tests/test_manager.py index b62ffc83f7..58446a0137 100644 --- a/tests/test_manager.py +++ b/tests/test_manager.py @@ -27,7 +27,13 @@ def get_community_repo() -> Repository: test_type=TestType.DEV_COMPATIBLE, package=Package.TERRA, package_version="0.18.0", - ) + ), + TestResult( + passed=True, + test_type=TestType.STANDARD, + package=Package.TERRA, + package_version="0.18.0", + ), ], tier=Tier.COMMUNITY, ) @@ -47,7 +53,13 @@ def get_community_fail_repo() -> Repository: test_type=TestType.DEV_COMPATIBLE, package=Package.TERRA, package_version="0.18.0", - ) + ), + TestResult( + passed=False, + test_type=TestType.STANDARD, + package=Package.TERRA, + package_version="0.18.0", + ), ], tier=Tier.COMMUNITY, )