|
1 |
| -name: Pin dependencies |
2 |
| -on: |
3 |
| - workflow_dispatch: |
4 |
| - schedule: |
5 |
| - - cron: '0 0 * * TUE' # run every Tuesday at midnight |
6 |
| - |
7 |
| -permissions: {} |
8 |
| - |
9 |
| -defaults: |
10 |
| - run: |
11 |
| - shell: bash |
12 |
| - |
13 |
| -jobs: |
14 |
| - pin: |
15 |
| - name: Generate dependency lock |
16 |
| - runs-on: ${{ matrix.os }} |
17 |
| - strategy: |
18 |
| - fail-fast: false # Don't cancel other jobs if one fails |
19 |
| - matrix: |
20 |
| - os: [ubuntu-latest, macos-latest, windows-latest] |
21 |
| - steps: |
22 |
| - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
23 |
| - - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 |
24 |
| - with: |
25 |
| - python-version: 3.11 |
26 |
| - cache: pip |
27 |
| - cache-dependency-path: | |
28 |
| - model_signing/install/requirements_${{ runner.os }}.txt |
29 |
| - model_signing/install/requirements_test_${{ runner.os }}.txt |
30 |
| - slsa_for_models/install/requirements_${{ runner.os }}.txt |
31 |
| - - name: Create an empty virtualenv and install `pip-tools` |
32 |
| - run: | |
33 |
| - set -exuo pipefail |
34 |
| - python -m venv venv |
35 |
| - .github/workflows/scripts/venv_activate.sh |
36 |
| - pip install pip-tools |
37 |
| - pip list # For debugging |
38 |
| - - name: Use `pip-compile` to generate all freeze files |
39 |
| - run: | |
40 |
| - set -exuo pipefail |
41 |
| - .github/workflows/scripts/venv_activate.sh |
42 |
| - pip-compile --upgrade --generate-hashes --strip-extras --output-file=model_signing/install/requirements_${{ runner.os }}.txt model_signing/install/requirements.in |
43 |
| - pip-compile --upgrade --generate-hashes --strip-extras --output-file=model_signing/install/requirements_test_${{ runner.os }}.txt model_signing/install/requirements_test.in |
44 |
| - pip-compile --upgrade --generate-hashes --strip-extras --output-file=slsa_for_models/install/requirements_${{ runner.os }}.txt slsa_for_models/install/requirements.in |
45 |
| - - name: Test freeze file (for model signing) |
46 |
| - run: | |
47 |
| - set -exuo pipefail |
48 |
| - rm -rf venv # Need clean sandbox |
49 |
| - python -m venv venv |
50 |
| - .github/workflows/scripts/venv_activate.sh |
51 |
| - pip install -r model_signing/install/requirements_${{ runner.os }}.txt |
52 |
| - pip list # For debugging |
53 |
| - - name: Test freeze file (for testing model signing) |
54 |
| - run: | |
55 |
| - set -exuo pipefail |
56 |
| - rm -rf venv # Need clean sandbox |
57 |
| - python -m venv venv |
58 |
| - .github/workflows/scripts/venv_activate.sh |
59 |
| - pip install -r model_signing/install/requirements_test_${{ runner.os }}.txt |
60 |
| - pip list # For debugging |
61 |
| - - name: Test freeze file (for SLSA for models) |
62 |
| - run: | |
63 |
| - set -exuo pipefail |
64 |
| - rm -rf venv # Need clean sandbox |
65 |
| - python -m venv venv |
66 |
| - .github/workflows/scripts/venv_activate.sh |
67 |
| - pip install -r slsa_for_models/install/requirements_${{ runner.os }}.txt |
68 |
| - pip list # For debugging |
69 |
| - - name: Upload freeze files |
70 |
| - uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 |
71 |
| - with: |
72 |
| - name: freeze-files-${{ matrix.os }} |
73 |
| - path: ./*/install/requirements*${{ runner.os }}*txt |
74 |
| - |
75 |
| - # Separate PR creation job to make sure it creates only one single PR with |
76 |
| - # all changed files, eliminate race-conditions and restrict permissions only |
77 |
| - # to this specific job. |
78 |
| - create-pr: |
79 |
| - needs: [pin] |
80 |
| - runs-on: ubuntu-latest |
81 |
| - permissions: |
82 |
| - contents: write |
83 |
| - pull-requests: write |
84 |
| - steps: |
85 |
| - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
86 |
| - - uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1 |
87 |
| - with: |
88 |
| - path: . |
89 |
| - merge-multiple: true |
90 |
| - - name: Create dependent PR with dependency changes |
91 |
| - uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2 |
92 |
| - with: |
93 |
| - title: "Update frozen python dependencies" |
94 |
| - commit-message: "Bump frozen dependencies" |
95 |
| - committer: "Mihai Maruseac (automated) <[email protected]>" |
96 |
| - author: "Mihai Maruseac (automated) <[email protected]>" |
97 |
| - signoff: true |
98 |
| - delete-branch: true |
| 1 | +name: Pin dependencies |
| 2 | +on: |
| 3 | + workflow_dispatch: |
| 4 | + schedule: |
| 5 | + - cron: '0 0 * * TUE' # run every Tuesday at midnight |
| 6 | + |
| 7 | +permissions: {} |
| 8 | + |
| 9 | +defaults: |
| 10 | + run: |
| 11 | + shell: bash |
| 12 | + |
| 13 | +jobs: |
| 14 | + pin: |
| 15 | + name: Generate dependency lock |
| 16 | + runs-on: ${{ matrix.os }} |
| 17 | + strategy: |
| 18 | + fail-fast: false # Don't cancel other jobs if one fails |
| 19 | + matrix: |
| 20 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
| 23 | + - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 |
| 24 | + with: |
| 25 | + python-version: 3.11 |
| 26 | + cache: pip |
| 27 | + cache-dependency-path: | |
| 28 | + model_signing/install/requirements_${{ runner.os }}.txt |
| 29 | + model_signing/install/requirements_test_${{ runner.os }}.txt |
| 30 | + slsa_for_models/install/requirements_${{ runner.os }}.txt |
| 31 | + - name: Create an empty virtualenv and install `pip-tools` |
| 32 | + run: | |
| 33 | + set -exuo pipefail |
| 34 | + python -m venv venv |
| 35 | + .github/workflows/scripts/venv_activate.sh |
| 36 | + pip install pip-tools |
| 37 | + pip list # For debugging |
| 38 | + - name: Use `pip-compile` to generate all freeze files |
| 39 | + run: | |
| 40 | + set -exuo pipefail |
| 41 | + .github/workflows/scripts/venv_activate.sh |
| 42 | + pip-compile --upgrade --generate-hashes --strip-extras --output-file=model_signing/install/requirements_${{ runner.os }}.txt model_signing/install/requirements.in |
| 43 | + pip-compile --upgrade --generate-hashes --strip-extras --output-file=model_signing/install/requirements_test_${{ runner.os }}.txt model_signing/install/requirements_test.in |
| 44 | + pip-compile --upgrade --generate-hashes --strip-extras --output-file=slsa_for_models/install/requirements_${{ runner.os }}.txt slsa_for_models/install/requirements.in |
| 45 | + - name: Test freeze file (for model signing) |
| 46 | + run: | |
| 47 | + set -exuo pipefail |
| 48 | + rm -rf venv # Need clean sandbox |
| 49 | + python -m venv venv |
| 50 | + .github/workflows/scripts/venv_activate.sh |
| 51 | + pip install -r model_signing/install/requirements_${{ runner.os }}.txt |
| 52 | + pip list # For debugging |
| 53 | + - name: Test freeze file (for testing model signing) |
| 54 | + run: | |
| 55 | + set -exuo pipefail |
| 56 | + rm -rf venv # Need clean sandbox |
| 57 | + python -m venv venv |
| 58 | + .github/workflows/scripts/venv_activate.sh |
| 59 | + pip install -r model_signing/install/requirements_test_${{ runner.os }}.txt |
| 60 | + pip list # For debugging |
| 61 | + - name: Test freeze file (for SLSA for models) |
| 62 | + run: | |
| 63 | + set -exuo pipefail |
| 64 | + rm -rf venv # Need clean sandbox |
| 65 | + python -m venv venv |
| 66 | + .github/workflows/scripts/venv_activate.sh |
| 67 | + pip install -r slsa_for_models/install/requirements_${{ runner.os }}.txt |
| 68 | + pip list # For debugging |
| 69 | + - name: Upload freeze files |
| 70 | + uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 |
| 71 | + with: |
| 72 | + name: freeze-files-${{ matrix.os }} |
| 73 | + path: ./*/install/requirements*${{ runner.os }}*txt |
| 74 | + |
| 75 | + # Separate PR creation job to make sure it creates only one single PR with |
| 76 | + # all changed files, eliminate race-conditions and restrict permissions only |
| 77 | + # to this specific job. |
| 78 | + create-pr: |
| 79 | + needs: [pin] |
| 80 | + runs-on: ubuntu-latest |
| 81 | + permissions: |
| 82 | + contents: write |
| 83 | + pull-requests: write |
| 84 | + steps: |
| 85 | + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
| 86 | + - uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1 |
| 87 | + with: |
| 88 | + path: . |
| 89 | + merge-multiple: true |
| 90 | + - name: Create dependent PR with dependency changes |
| 91 | + uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2 |
| 92 | + with: |
| 93 | + title: "Update frozen python dependencies" |
| 94 | + commit-message: "Bump frozen dependencies" |
| 95 | + committer: "Mihai Maruseac (automated) <[email protected]>" |
| 96 | + author: "Mihai Maruseac (automated) <[email protected]>" |
| 97 | + signoff: true |
| 98 | + delete-branch: true |
0 commit comments