Nightly CI Dispatcher #354
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: Nightly CI Dispatcher | |
| on: | |
| #push: | |
| # branches: | |
| # - develop | |
| schedule: | |
| - cron: "0 0 * * *" | |
| jobs: | |
| nightly-ci-matrix: | |
| name: Nightly CI | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| branch: | |
| - develop | |
| - release/2.9 | |
| repo: [mayastor, mayastor-control-plane, mayastor-extensions] | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup | |
| id: start | |
| run: | | |
| start_time=$(date -u +"%Y-%m-%dT%H:%M:%SZ") | |
| echo "Started at $start_time" | |
| echo "START_TIME=$start_time" >> $GITHUB_OUTPUT | |
| - name: Dispatch | |
| id: dispatch | |
| uses: the-actions-org/workflow-dispatch@v4 | |
| with: | |
| token: ${{ secrets.ORG_CI_GITHUB }} | |
| repo: openebs/${{ matrix.repo }} | |
| ref: ${{ matrix.branch }} | |
| workflow: nightly-ci.yml | |
| wait-for-completion: false | |
| display-workflow-run-url-timeout: 1h | |
| display-workflow-run-url-interval: 15s | |
| display-workflow-run-url: true | |
| - run: | | |
| echo "Dispatched workflow ${{ steps.dispatch.outputs.workflow-id }} for ${{ matrix.repo }}@${{ matrix.branch }}" | |
| - name: Find workflow | |
| id: find | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.ORG_CI_GITHUB }} | |
| WORKFLOW_ID: nightly-ci.yml | |
| MAX_FIND_MINUTES: 3 | |
| INTERVAL_SECS: 15 | |
| ORG_NAME: openebs | |
| REPO_NAME: ${{ matrix.repo }} | |
| REF: ${{ matrix.branch }} | |
| START_TIME: ${{ steps.start.outputs.START_TIME }} | |
| WAIT: false | |
| run: ./wait-for-workflow.sh | |
| - name: Await | |
| id: await | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.ORG_CI_GITHUB }} | |
| WORKFLOW_ID: nightly-ci.yml | |
| INTERVAL_SECS: 60 | |
| TIMEOUT_MINUTES: 360 | |
| ORG_NAME: openebs | |
| REPO_NAME: ${{ matrix.repo }} | |
| REF: ${{ matrix.branch }} | |
| RUN_ID: ${{ steps.find.outputs.workflow-id }} | |
| run: ./wait-for-workflow.sh | |
| - name: Print Status | |
| if: always() | |
| run: | | |
| echo "Workflow for ${{ matrix.repo }}@${{ matrix.branch }} completed with status: ${{ steps.await.outputs.workflow-conclusion }}" | |
| echo "For more details, see ${{ steps.find.outputs.workflow-url }}" | |
| - name: Cancel | |
| if: cancelled() | |
| run: | | |
| curl -s -X POST \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -H "Authorization: token ${{ secrets.ORG_CI_GITHUB }}" \ | |
| ${{ steps.find.outputs.workflow-api-url }}/cancel | |
| nightly-ci: | |
| name: Collect All Runs | |
| needs: nightly-ci-matrix | |
| runs-on: ubuntu-latest | |
| if: always() | |
| steps: | |
| - name: Workflow Complete | |
| if: always() | |
| run: echo "All matrix jobs have completed!" |