|
| 1 | +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. |
| 2 | +# |
| 3 | +# SPDX-License-Identifier: Apache-2.0 |
| 4 | + |
| 5 | +# Monthly (and on-demand) pixi lockfile refresh. Each workspace gets its own |
| 6 | +# PR so a benchmark or docs environment cannot drag unrelated package churn |
| 7 | +# into review. See #2298. |
| 8 | + |
| 9 | +name: "CI: pixi lockfile refresh" |
| 10 | + |
| 11 | +on: |
| 12 | + schedule: |
| 13 | + # 08:17 UTC on the 1st of each month. Offset from hour-start load and |
| 14 | + # from the daily CI / pixi source-test windows. |
| 15 | + - cron: "17 8 1 * *" |
| 16 | + workflow_dispatch: |
| 17 | + inputs: |
| 18 | + package: |
| 19 | + description: "Pixi workspace to refresh" |
| 20 | + type: choice |
| 21 | + default: all |
| 22 | + options: |
| 23 | + - all |
| 24 | + - root |
| 25 | + - cuda_pathfinder |
| 26 | + - cuda_bindings |
| 27 | + - cuda_core |
| 28 | + - benchmarks/cuda_bindings |
| 29 | + - benchmarks/cuda_core |
| 30 | + |
| 31 | +defaults: |
| 32 | + run: |
| 33 | + shell: bash --noprofile --norc -xeuo pipefail {0} |
| 34 | + |
| 35 | +env: |
| 36 | + # Keep in sync with ci-pixi-source-test.yml. |
| 37 | + PIXI_VERSION: "v0.73.0" |
| 38 | + |
| 39 | +permissions: {} |
| 40 | + |
| 41 | +jobs: |
| 42 | + # Job-level `if` cannot use `matrix` (evaluated before expansion). Filter |
| 43 | + # the workspace list here and pass it to refresh as a dynamic matrix. |
| 44 | + plan: |
| 45 | + name: Select workspaces |
| 46 | + if: ${{ github.repository_owner == 'nvidia' }} |
| 47 | + runs-on: ubuntu-latest |
| 48 | + timeout-minutes: 5 |
| 49 | + outputs: |
| 50 | + matrix: ${{ steps.select.outputs.matrix }} |
| 51 | + steps: |
| 52 | + - name: Select workspaces to refresh |
| 53 | + id: select |
| 54 | + env: |
| 55 | + PACKAGE: ${{ inputs.package || 'all' }} |
| 56 | + run: | |
| 57 | + all='[ |
| 58 | + {"id":"root","manifest":".","lockfile":"pixi.lock"}, |
| 59 | + {"id":"cuda_pathfinder","manifest":"cuda_pathfinder","lockfile":"cuda_pathfinder/pixi.lock"}, |
| 60 | + {"id":"cuda_bindings","manifest":"cuda_bindings","lockfile":"cuda_bindings/pixi.lock"}, |
| 61 | + {"id":"cuda_core","manifest":"cuda_core","lockfile":"cuda_core/pixi.lock"}, |
| 62 | + {"id":"benchmarks/cuda_bindings","manifest":"benchmarks/cuda_bindings","lockfile":"benchmarks/cuda_bindings/pixi.lock"}, |
| 63 | + {"id":"benchmarks/cuda_core","manifest":"benchmarks/cuda_core","lockfile":"benchmarks/cuda_core/pixi.lock"} |
| 64 | + ]' |
| 65 | + if [ "${PACKAGE}" = "all" ]; then |
| 66 | + selected="${all}" |
| 67 | + else |
| 68 | + selected="$(jq -c --arg id "${PACKAGE}" '[.[] | select(.id == $id)]' <<<"${all}")" |
| 69 | + if [ "${selected}" = "[]" ]; then |
| 70 | + echo "::error::Unknown package '${PACKAGE}'" |
| 71 | + exit 1 |
| 72 | + fi |
| 73 | + fi |
| 74 | + echo "matrix=$(jq -c '{include:.}' <<<"${selected}")" >> "${GITHUB_OUTPUT}" |
| 75 | +
|
| 76 | + refresh: |
| 77 | + name: "pixi update (${{ matrix.id }})" |
| 78 | + needs: plan |
| 79 | + runs-on: ubuntu-latest |
| 80 | + timeout-minutes: 30 |
| 81 | + permissions: |
| 82 | + contents: write |
| 83 | + pull-requests: write |
| 84 | + concurrency: |
| 85 | + group: pixi-lock-refresh-${{ matrix.id }} |
| 86 | + cancel-in-progress: false |
| 87 | + strategy: |
| 88 | + fail-fast: false |
| 89 | + matrix: ${{ fromJSON(needs.plan.outputs.matrix) }} |
| 90 | + steps: |
| 91 | + - name: Checkout ${{ github.event.repository.name }} |
| 92 | + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 93 | + with: |
| 94 | + fetch-depth: 0 |
| 95 | + ref: ${{ github.event.repository.default_branch }} |
| 96 | + |
| 97 | + - name: Setup pixi |
| 98 | + # Pinned to a commit SHA; install logic lives in the action and is |
| 99 | + # auditable/pinned (vs. a curl|bash of an unverified installer). |
| 100 | + uses: prefix-dev/setup-pixi@5185adfbffb4bd703da3010310260805d89ebb11 # v0.9.6 |
| 101 | + with: |
| 102 | + pixi-version: ${{ env.PIXI_VERSION }} |
| 103 | + run-install: false |
| 104 | + |
| 105 | + - name: Update lockfile without installing |
| 106 | + run: pixi update --no-install --manifest-path "${{ matrix.manifest }}" |
| 107 | + |
| 108 | + - name: Open or update a lockfile-only PR |
| 109 | + id: cpr |
| 110 | + uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 |
| 111 | + with: |
| 112 | + token: ${{ github.token }} |
| 113 | + add-paths: ${{ matrix.lockfile }} |
| 114 | + commit-message: | |
| 115 | + chore: refresh pixi.lock for ${{ matrix.id }} |
| 116 | +
|
| 117 | + Scheduled pixi update --no-install for this workspace only. |
| 118 | + signoff: true |
| 119 | + sign-commits: true |
| 120 | + branch: ci/pixi-lock-refresh/${{ matrix.id }} |
| 121 | + delete-branch: true |
| 122 | + title: "chore: refresh pixi.lock (${{ matrix.id }})" |
| 123 | + labels: | |
| 124 | + CI/CD |
| 125 | + dependencies |
| 126 | + body: | |
| 127 | + Automated lockfile refresh for `${{ matrix.id }}` (`pixi update --no-install --manifest-path ${{ matrix.manifest }}`). |
| 128 | +
|
| 129 | + This PR is workspace-scoped so other packages are not forced to review unrelated solver churn. See #2298. |
| 130 | +
|
| 131 | + If the diff looks wrong, close this PR and leave the branch deleted; the next scheduled run will open a fresh one if an update is still needed. |
| 132 | + author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> |
| 133 | + committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> |
| 134 | + |
| 135 | + - name: Summarize |
| 136 | + run: | |
| 137 | + { |
| 138 | + echo "### pixi lock refresh (${{ matrix.id }})" |
| 139 | + echo "" |
| 140 | + echo "- Manifest: \`${{ matrix.manifest }}\`" |
| 141 | + echo "- Lockfile: \`${{ matrix.lockfile }}\`" |
| 142 | + echo "- Operation: \`${{ steps.cpr.outputs.pull-request-operation }}\`" |
| 143 | + if [ -n "${{ steps.cpr.outputs.pull-request-url }}" ]; then |
| 144 | + echo "- PR: ${{ steps.cpr.outputs.pull-request-url }}" |
| 145 | + else |
| 146 | + echo "- No lockfile diff; PR not opened." |
| 147 | + fi |
| 148 | + } >> "$GITHUB_STEP_SUMMARY" |
0 commit comments