Trigger Nightly cuOpt Pipeline #77
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: Trigger Nightly cuOpt Pipeline | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 5 * * *" # 5am UTC / 1am EST | |
| jobs: | |
| trigger-build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - cuopt_version: "25.08" | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Trigger Pipeline | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| export CUOPT_BRANCH="branch-${{ matrix.cuopt_version }}" | |
| export DATE=$(date +%F) | |
| export SHA=$(gh api -q '.commit.sha' "repos/nvidia/cuopt/branches/${CUOPT_BRANCH}") | |
| gh workflow run build.yaml \ | |
| -f branch="${CUOPT_BRANCH}" \ | |
| -f sha="${SHA}" \ | |
| -f date="${DATE}" \ | |
| -f build_type=nightly | |
| # Wait a short bit for the workflow to register (optional) | |
| sleep 3 | |
| # Get the latest run ID for this workflow on this branch | |
| RUN_ID=$(gh run list --workflow=build.yaml --branch="${CUOPT_BRANCH}" --json databaseId --limit 1 | jq -r '.[0].databaseId') | |
| STATUS=$(gh run view $RUN_ID --json status,conclusion --jq '.status') | |
| CONCLUSION=$(gh run view $RUN_ID --json status,conclusion --jq '.conclusion') | |
| while [[ "$STATUS" != "completed" || "$CONCLUSION" == "null" ]]; do | |
| echo "Status: $STATUS, Conclusion: $CONCLUSION — waiting 10 seconds..." | |
| sleep 10 | |
| STATUS=$(gh run view $RUN_ID --json status,conclusion --jq '.status') | |
| CONCLUSION=$(gh run view $RUN_ID --json status,conclusion --jq '.conclusion') | |
| done | |
| echo "Workflow run finished with conclusion: $CONCLUSION" | |
| if [[ "$CONCLUSION" != "success" ]]; then | |
| echo "Build did not succeed" | |
| exit 1 | |
| fi | |
| trigger-test: | |
| runs-on: ubuntu-latest | |
| needs: trigger-build | |
| strategy: | |
| matrix: | |
| include: | |
| - cuopt_version: "25.08" | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Trigger Test | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| export CUOPT_BRANCH="branch-${{ matrix.cuopt_version }}" | |
| export DATE=$(date +%F) | |
| export SHA=$(gh api -q '.commit.sha' "repos/nvidia/cuopt/branches/${CUOPT_BRANCH}") | |
| gh workflow run test.yaml \ | |
| -f branch=${CUOPT_BRANCH} \ | |
| -f sha=${SHA} \ | |
| -f date=${DATE} \ | |
| -f build_type=nightly | |