Skip to content

Commit 435b8b3

Browse files
CI: pin GitHub Actions to SHA, add dependabot for automatic updates (#1977)
1 parent 78a8478 commit 435b8b3

5 files changed

Lines changed: 45 additions & 44 deletions

File tree

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
cooldown:
8+
default-days: 7
9+
groups:
10+
actions:
11+
patterns:
12+
- "*"

.github/dependabot.yml.disabled

Lines changed: 0 additions & 11 deletions
This file was deleted.

.github/workflows/lint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
Lint:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v4
14-
- uses: actions/setup-python@v4
13+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
14+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
1515
with:
1616
python-version: "3.12"
17-
- uses: pre-commit/action@v3.0.0
17+
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
1818
env:
1919
RUFF_OUTPUT_FORMAT: github

.github/workflows/python-package.yml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@ jobs:
3434
os: [ubuntu-22.04, ubuntu-22.04-arm, windows-2025, windows-11-arm, macos-15]
3535
runs-on: ${{ matrix.os }}
3636
steps:
37-
- uses: actions/checkout@v4
37+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
3838
- name: Setup MSVC
3939
if: runner.os == 'Windows'
40-
uses: ilammy/msvc-dev-cmd@v1.13.0 # to use cl
40+
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
4141
with:
4242
arch: ${{ runner.arch == 'ARM64' && 'arm64' || 'x64' }}
4343
- name: Build C++
4444
run: bash .github/scripts/build-cpu.sh
4545
- name: Upload build artifact
46-
uses: actions/upload-artifact@v4
46+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
4747
with:
4848
name: shared_library_${{ runner.os }}_${{ runner.arch }}
4949
path: output/*
@@ -62,7 +62,7 @@ jobs:
6262
["11.8.0", "12.0.1", "12.1.1", "12.2.2", "12.3.2", "12.4.1", "12.5.1", "12.6.3", "12.8.1", "12.9.1", "13.0.2", "13.2.0"]
6363
runs-on: ${{ matrix.os }}
6464
steps:
65-
- uses: actions/checkout@v4
65+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
6666
# Windows: We install Cuda on the agent (slow)
6767
- uses: Jimver/cuda-toolkit@3d45d157f327c09c04b50ee6ccdea2d9d017ec76 # v0.2.35
6868
if: runner.os == 'Windows'
@@ -77,15 +77,15 @@ jobs:
7777
log-file-suffix: ${{ runner.os }}-${{ runner.arch }}-${{matrix.cuda_version}}.txt
7878
- name: Setup MSVC
7979
if: runner.os == 'Windows'
80-
uses: ilammy/msvc-dev-cmd@v1.13.0 # to use cl
80+
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
8181
with:
8282
toolset: "14.44"
8383
- name: Build C++
8484
run: bash .github/scripts/build-cuda.sh
8585
env:
8686
CUDA_VERSION: ${{ matrix.cuda_version }}
8787
- name: Upload build artifact
88-
uses: actions/upload-artifact@v4
88+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
8989
with:
9090
name: shared_library_cuda_${{ runner.os }}_${{ runner.arch }}_${{ matrix.cuda_version }}
9191
path: output/*
@@ -98,7 +98,7 @@ jobs:
9898
os: [ubuntu-22.04, windows-2022]
9999
runs-on: ${{ matrix.os }}
100100
steps:
101-
- uses: actions/checkout@v4
101+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
102102
- name: Build C++ (Linux)
103103
if: runner.os == 'Linux'
104104
run: bash .github/scripts/build-xpu.sh
@@ -107,7 +107,7 @@ jobs:
107107
run: .github/scripts/build-xpu-windows.bat
108108
shell: cmd
109109
- name: Upload build artifact
110-
uses: actions/upload-artifact@v4
110+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
111111
with:
112112
name: shared_library_xpu_${{ runner.os }}_${{ runner.arch }}
113113
path: output/*
@@ -124,7 +124,7 @@ jobs:
124124
rocm_version: "7.2.1"
125125
runs-on: ${{ matrix.os }}
126126
steps:
127-
- uses: actions/checkout@v4
127+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
128128
- name: Clean up disk space
129129
if: runner.os == 'Linux'
130130
run: |
@@ -144,15 +144,15 @@ jobs:
144144
df -h
145145
- name: Setup MSVC
146146
if: runner.os == 'Windows'
147-
uses: ilammy/msvc-dev-cmd@v1.13.0
147+
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
148148
with:
149149
toolset: "14.44"
150150
- name: Build C++
151151
run: bash .github/scripts/build-rocm.sh
152152
env:
153153
ROCM_VERSION: ${{ matrix.rocm_version }}
154154
- name: Upload build artifact
155-
uses: actions/upload-artifact@v4
155+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
156156
with:
157157
name: shared_library_rocm_${{ runner.os }}_${{ runner.arch }}_${{ matrix.rocm_version }}
158158
path: output/*
@@ -176,9 +176,9 @@ jobs:
176176
# dictated by the packaged code itself, not the Python version used for packaging.
177177
runs-on: ${{ matrix.os }}
178178
steps:
179-
- uses: actions/checkout@v4
179+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
180180
- name: Download build artifacts
181-
uses: actions/download-artifact@v4
181+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
182182
with:
183183
merge-multiple: true
184184
pattern: "shared_library*_${{ runner.os }}_${{ runner.arch }}*"
@@ -189,7 +189,7 @@ jobs:
189189
ls -lR output/
190190
cp output/${{ runner.os }}/${{ runner.arch }}/* bitsandbytes/
191191
- name: Set up Python
192-
uses: actions/setup-python@v5
192+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
193193
with:
194194
python-version: "3.12"
195195
cache: pip
@@ -202,7 +202,7 @@ jobs:
202202
echo "PLATFORM_TAG=$PLATFORM_TAG"
203203
wheel tags --remove --abi-tag=none --python-tag=py3 --platform-tag=$PLATFORM_TAG dist/bitsandbytes-*.whl
204204
- name: Upload build artifact
205-
uses: actions/upload-artifact@v4
205+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
206206
with:
207207
name: bdist_wheel_${{ runner.os }}_${{ runner.arch }}
208208
path: dist/bitsandbytes-*.whl
@@ -220,7 +220,7 @@ jobs:
220220
- build-wheels
221221
steps:
222222
- name: Download and rename artifacts
223-
uses: actions/download-artifact@v4
223+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
224224
with:
225225
path: tmp/
226226
pattern: "bdist_wheel_*"
@@ -261,7 +261,7 @@ jobs:
261261
- name: Inspect wheels directory after renaming files
262262
run: ls -alFR wheels/
263263

264-
- uses: actions/checkout@v4
264+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
265265
with:
266266
path: repo
267267

@@ -341,7 +341,7 @@ jobs:
341341
cat body.md
342342
343343
- name: Create new pre-release and upload artifacts
344-
uses: softprops/action-gh-release@v2.2.1
344+
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0
345345
with:
346346
files: wheels/*.whl
347347
prerelease: true
@@ -360,14 +360,14 @@ jobs:
360360
env:
361361
PIP_DISABLE_PIP_VERSION_CHECK: 1
362362
steps:
363-
- uses: actions/checkout@v4
363+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
364364
- name: Download wheel
365-
uses: actions/download-artifact@v4
365+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
366366
with:
367367
name: bdist_wheel_${{ runner.os }}_${{ runner.arch }}
368368
path: wheels/
369369
- name: Set up Python
370-
uses: actions/setup-python@v5
370+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
371371
with:
372372
python-version: "3.12"
373373
- run: pip install auditwheel
@@ -387,13 +387,13 @@ jobs:
387387
id-token: write
388388
steps:
389389
- name: Download distribution artifacts
390-
uses: actions/download-artifact@v4
390+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
391391
with:
392392
path: dist/
393393
pattern: "bdist_wheel_*"
394394
merge-multiple: true
395395

396396
- name: Publish to PyPI
397-
uses: pypa/gh-action-pypi-publish@release/v1
397+
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
398398
with:
399399
print-hash: true

.github/workflows/test-runner.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ jobs:
9393
echo "test_runner=${TEST_RUNNER}" >> $GITHUB_OUTPUT
9494
echo "artifact_name=${ARTIFACT}" >> $GITHUB_OUTPUT
9595
96-
- uses: actions/checkout@v4
96+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
9797

9898

9999
# Windows + CUDA: Install CUDA Toolkit
@@ -109,7 +109,7 @@ jobs:
109109
# Windows: Setup MSVC (needed for both CPU and CUDA builds)
110110
- name: Setup MSVC
111111
if: startsWith(inputs.platform, 'windows')
112-
uses: ilammy/msvc-dev-cmd@v1.13.0
112+
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
113113
with:
114114
arch: ${{ inputs.platform == 'windows-arm64' && 'arm64' || 'x64' }}
115115
toolset: ${{ (inputs.platform == 'windows' && inputs.backend == 'cuda') && '14.44' || '' }}
@@ -128,7 +128,7 @@ jobs:
128128
CUDA_TARGETS: "75;80;89"
129129

130130
- name: Upload build artifact
131-
uses: actions/upload-artifact@v4
131+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
132132
with:
133133
name: ${{ steps.config.outputs.artifact_name }}
134134
path: output/${{ runner.os }}/${{ runner.arch }}/*
@@ -146,25 +146,25 @@ jobs:
146146
if: inputs.backend == 'cuda'
147147
run: nvidia-smi
148148

149-
- uses: actions/checkout@v4
149+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
150150

151151
- name: Download build artifact
152-
uses: actions/download-artifact@v4
152+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
153153
with:
154154
name: ${{ needs.build.outputs.artifact_name }}
155155
path: bitsandbytes/
156156
merge-multiple: true
157157

158158
- name: Setup Python
159-
uses: actions/setup-python@v5
159+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
160160
with:
161161
# Python for Windows ARM64 is only available from 3.12+
162162
python-version: ${{ inputs.platform == 'windows-arm64' && '3.12' || '3.10' }}
163163

164164
# Windows: Setup MSVC for torch.compile
165165
- name: Setup MSVC
166166
if: startsWith(inputs.platform, 'windows')
167-
uses: ilammy/msvc-dev-cmd@v1.13.0
167+
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
168168
with:
169169
arch: ${{ inputs.platform == 'windows-arm64' && 'arm64' || 'x64' }}
170170

0 commit comments

Comments
 (0)