Quantum runtime for peaked circuit 49q x 5072 CZ's on heavy-hex #103
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Submissions workflow | |
| on: | |
| issues: | |
| types: [labeled] | |
| jobs: | |
| process_verified_submission: | |
| runs-on: ubuntu-latest | |
| if: contains(github.event.issue.labels.*.name, 'submission') && github.event.label.name == 'verified' | |
| permissions: | |
| pull-requests: write | |
| contents: write | |
| steps: | |
| - name: Determine path based on labels | |
| id: path_selector | |
| run: | | |
| ISSUE_TEMPLATE_PATH="" | |
| SUBMISSIONS_PATH="" | |
| JSON_LABELS='${{ toJSON(github.event.issue.labels.*.name) }}' | |
| readarray -t LABELS <<< "$(echo "$JSON_LABELS" | jq -r '.[]')" | |
| for LABEL in "${LABELS[@]}"; do | |
| case "$LABEL" in | |
| "path: observable-estimations") | |
| ISSUE_TEMPLATE_PATH="01-submission-path-observable-estimations.yml" | |
| SUBMISSIONS_PATH="data/observable-estimations/submissions.json" | |
| break | |
| ;; | |
| "path: variational-problems") | |
| ISSUE_TEMPLATE_PATH="02-submission-path-variational-problems.yml" | |
| SUBMISSIONS_PATH="data/variational-problems/submissions.json" | |
| break | |
| ;; | |
| "path: classically-verifiable-problems") | |
| ISSUE_TEMPLATE_PATH="03-submission-path-classically-verifiable-problems.yml" | |
| SUBMISSIONS_PATH="data/classically-verifiable-problems/submissions.json" | |
| break | |
| ;; | |
| esac | |
| done | |
| if [ -z "$ISSUE_TEMPLATE_PATH" ]; then | |
| echo "::error::No valid template label was found on the issue." | |
| echo "::error::Processing skipped as the correct form template cannot be determined." | |
| exit 1 | |
| fi | |
| echo "selected_issue_template=$ISSUE_TEMPLATE_PATH" >> $GITHUB_OUTPUT | |
| echo "Selected issue template: $ISSUE_TEMPLATE_PATH" | |
| echo "selected_submissions_path=$SUBMISSIONS_PATH" >> $GITHUB_OUTPUT | |
| echo "Selected submissions path: $SUBMISSIONS_PATH" | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Parse issue body | |
| id: issue_form_parser | |
| uses: issue-ops/parser@v4 | |
| with: | |
| body: ${{ github.event.issue.body }} | |
| issue-form-template: ${{ steps.path_selector.outputs.selected_issue_template }} | |
| - name: Modify parsed JSON | |
| id: modify_json | |
| env: | |
| INPUT_JSON: ${{ steps.issue_form_parser.outputs.json }} | |
| ISSUE_CREATED_AT: ${{ github.event.issue.created_at }} | |
| ISSUE_URL: ${{ github.event.issue.html_url }} | |
| run: | | |
| SUBMISSION=$(node .github/workflows/parse-submission.js "$INPUT_JSON") | |
| echo "submission=$SUBMISSION" >> $GITHUB_OUTPUT | |
| - name: Modify submissions file | |
| env: | |
| SUBMISSIONS_PATH: ${{ steps.path_selector.outputs.selected_submissions_path }} | |
| SUBMISSION: ${{ steps.modify_json.outputs.submission }} | |
| run: | | |
| tmp_file=$(mktemp) | |
| jq ". += [${SUBMISSION}]" "$SUBMISSIONS_PATH" > "$tmp_file" && mv "$tmp_file" "$SUBMISSIONS_PATH" | |
| - name: Create pull request | |
| id: create_pull_request | |
| uses: peter-evans/create-pull-request@v7 | |
| with: | |
| commit-message: 'Add new submission from issue #${{ github.event.issue.number }}' | |
| title: 'Add new submission from issue #${{ github.event.issue.number }}' | |
| body: 'Closes #${{ github.event.issue.number }}.' | |
| branch: submission-issue-${{ github.event.issue.number }} | |
| # Disabled because of: | |
| # https://docs.github.com/en/actions/how-tos/write-workflows/choose-when-workflows-run/trigger-a-workflow#triggering-a-workflow-from-a-workflow | |
| # - name: Enable pull request auto-merge | |
| # if: steps.create_pull_request.outputs.pull-request-operation == 'created' | |
| # run: gh pr merge --merge --auto "${{ steps.create_pull_request.outputs.pull-request-number }}" | |
| # env: | |
| # GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |