Skip to content

Commit

Permalink
[CI] Dev and stable check only informational (#461)
Browse files Browse the repository at this point in the history
* force string for output

* Revert "force string for output"

This reverts commit cabecb9.

* make stable and dev check informational + badge good when only standard

* set messages

* update unit tests

* lint

* lint

* fork doesn't sync

* fork sync

* Update .github/workflows/ecosystem-submission.yml

Co-authored-by: Frank Harkins <[email protected]>

Co-authored-by: Frank Harkins <[email protected]>

* add assert for set_actions_output
Co-authored-by: Frank Harkins <[email protected]>

* Revert "add assert for set_actions_output"

This reverts commit 51c0f56.

* Update .github/workflows/ecosystem-submission.yml

Co-authored-by: Frank Harkins <[email protected]>

* Update .github/workflows/ecosystem-submission.yml

Co-authored-by: Frank Harkins <[email protected]>

* no regex in actions if

* clear condition

---------

Co-authored-by: Frank Harkins <[email protected]>
  • Loading branch information
mickahell and frankharkins authored Aug 1, 2023
1 parent cb32fbb commit 616d1ec
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 24 deletions.
84 changes: 63 additions & 21 deletions .github/workflows/ecosystem-submission.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -125,16 +129,16 @@ 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 }}
body: |
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 }}
Expand All @@ -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 }}
5 changes: 4 additions & 1 deletion ecosystem/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 14 additions & 2 deletions tests/test_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand All @@ -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,
)
Expand Down

0 comments on commit 616d1ec

Please sign in to comment.