-
Notifications
You must be signed in to change notification settings - Fork 53
187 lines (174 loc) · 7.96 KB
/
ecosystem-submission.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
name: Ecosystem | Submission check
###
# - install deps
# - parse issue
# - run lint, coverage, tests
# - comment result
# - link pr to issue
on:
issues:
types: [opened, edited, reopened]
jobs:
submission_workflow:
concurrency:
group: ci-${{ github.event.issue.title }}
cancel-in-progress: true
if: startsWith(github.event.issue.title, '[Submission]:')
runs-on: ubuntu-latest
env:
tox_env: "py39"
tier: "Community"
python-version: "3.9"
steps:
# setup deps
- uses: actions/checkout@v3
- name: Set up Python ${{ env.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
# workflow
- name: Parse submission
id: parse-issue
env:
ISSUE_BODY: ${{ github.event.issue.body }}
run: python manager.py parser_issue --body="$ISSUE_BODY"
- name: Tests stable check
id: stable
uses: ./.github/actions/run-tests
with:
repo_url: ${{ steps.parse-issue.outputs.SUBMISSION_REPO }}
test_type: "stable"
tox_env: ${{ env.tox_env }}
tier: ${{ env.tier }}
logs_link: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
- name: Tests dev check
id: dev
uses: ./.github/actions/run-tests
with:
repo_url: ${{ steps.parse-issue.outputs.SUBMISSION_REPO }}
test_type: "development"
tox_env: ${{ env.tox_env }}
tier: ${{ env.tier }}
logs_link: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
- name: Tests standard repo check
id: standard
uses: ./.github/actions/run-tests
with:
repo_url: ${{ steps.parse-issue.outputs.SUBMISSION_REPO }}
test_type: "standard"
tox_env: ${{ env.tox_env }}
tier: ${{ env.tier }}
logs_link: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
# Check result, update issue and create PR
- name: Check return
id: check-return
run: |
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:
SUBMISSION_NAME: ${{ steps.parse-issue.outputs.SUBMISSION_NAME }}
SUBMISSION_REPO: ${{ steps.parse-issue.outputs.SUBMISSION_REPO }}
SUBMISSION_DESCRIPTION: ${{ steps.parse-issue.outputs.SUBMISSION_DESCRIPTION }}
SUBMISSION_LICENCE: ${{ steps.parse-issue.outputs.SUBMISSION_LICENCE }}
SUBMISSION_CONTACT: ${{ steps.parse-issue.outputs.SUBMISSION_CONTACT }}
SUBMISSION_ALTERNATIVES: ${{ steps.parse-issue.outputs.SUBMISSION_ALTERNATIVES }}
SUBMISSION_AFFILIATIONS: ${{ steps.parse-issue.outputs.SUBMISSION_AFFILIATIONS }}
SUBMISSION_LABELS: ${{ steps.parse-issue.outputs.SUBMISSION_LABELS }}
SUBMISSION_WEBSITE: ${{ steps.parse-issue.outputs.SUBMISSION_WEBSITE }}
run: |
python manager.py add_repo_2db --repo_name="$SUBMISSION_NAME" \
--repo_link="$SUBMISSION_REPO" \
--repo_description="$SUBMISSION_DESCRIPTION" \
--repo_licence="$SUBMISSION_LICENCE" \
--repo_contact="$SUBMISSION_CONTACT" \
--repo_alt="$SUBMISSION_ALTERNATIVES" \
--repo_affiliations="$SUBMISSION_AFFILIATIONS" \
--repo_labels="$SUBMISSION_LABELS" \
--repo_website="$SUBMISSION_WEBSITE"
- name: Commit changes and create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v5
with:
commit-message: Submission - Add ${{ steps.parse-issue.outputs.SUBMISSION_REPO }} to list.
title: Add ${{ steps.parse-issue.outputs.SUBMISSION_NAME }} to list.
body: |
Add ${{ steps.parse-issue.outputs.SUBMISSION_NAME }} to list.
Closes #${{ github.event.issue.number }}
branch: submission-${{ github.event.issue.number }}
base: main
- 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_STD != 'True' }}
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ github.event.issue.number }}
body: |
Submission PR #${{ steps.cpr.outputs.pull-request-number }} has been created with errors in tests :warning:
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 }}