File: cache-pixi-lock.yml

package info (click to toggle)
python-xarray 2025.12.0-5
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 13,584 kB
  • sloc: python: 118,720; makefile: 269
file content (52 lines) | stat: -rw-r--r-- 1,493 bytes parent folder | download
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
name: Generate and cache Pixi lockfile

on:
  workflow_call:
    inputs:
      pixi-version:
        type: string
    outputs:
      cache-id:
        description: "The lock file contents"
        value: ${{ jobs.cache-pixi-lock.outputs.cache-id }}

jobs:
  cache-pixi-lock:
    name: Pixi lock
    runs-on: ubuntu-latest
    outputs:
      cache-id: ${{ steps.restore.outputs.cache-primary-key }}
    steps:
      - uses: actions/checkout@v5
        with:
          fetch-depth: 0
          submodules: recursive
      - name: Get current date
        id: date
        run: echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT"
      - uses: actions/cache/restore@v4
        id: restore
        with:
          path: |
            pixi.lock
          key: ${{ steps.date.outputs.date }}_${{ inputs.pixi-version }}_${{hashFiles('pixi.toml')}}
      - uses: prefix-dev/setup-pixi@v0.9.0
        if: ${{ !steps.restore.outputs.cache-hit }}
        with:
          pixi-version: ${{ inputs.pixi-version }}
          run-install: false
      - name: Run pixi lock
        if: ${{ !steps.restore.outputs.cache-hit }}
        run: pixi lock
      - uses: actions/cache/save@v4
        if: ${{ !steps.restore.outputs.cache-hit }}
        id: cache
        with:
          path: |
            pixi.lock
          key: ${{ steps.restore.outputs.cache-primary-key }}
      - name: Upload pixi.lock
        uses: actions/upload-artifact@v4
        with:
          name: pixi-lock
          path: pixi.lock