Skip to content

Commit 2cad3ee

Browse files
committed
Test CI pre-commit optimization
1 parent 0dc1d77 commit 2cad3ee

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

.github/actions/common-setup/action.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,18 @@ inputs:
99
description: Free disk space
1010
required: false
1111
default: "false"
12+
build-type:
13+
description: Type of build (pre-commit, test, release)
14+
required: false
15+
default: "release"
1216

1317
runs:
1418
using: "composite"
1519
steps:
1620
# > --------------------------------------------------
1721
# > OS
1822
- name: Free disk space (Ubuntu)
19-
if: inputs.free-disk-space == 'true' && runner.os == 'Linux'
23+
if: inputs.free-disk-space == 'true' && runner.os == 'Linux' && inputs.build-type != 'pre-commit'
2024
# https://github.com/jlumbroso/free-disk-space
2125
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
2226
with:
@@ -29,7 +33,7 @@ runs:
2933
swap-storage: true
3034

3135
- name: Free disk space (Windows)
32-
if: inputs.free-disk-space == 'true' && runner.os == 'Windows'
36+
if: inputs.free-disk-space == 'true' && runner.os == 'Windows' && inputs.build-type != 'pre-commit'
3337
shell: bash
3438
run: |
3539
rm -rf "/c/Program Files/dotnet"
@@ -88,6 +92,7 @@ runs:
8892
override: true
8993

9094
- name: Install cargo-nextest
95+
if: inputs.build-type != 'pre-commit'
9196
# https://github.com/taiki-e/install-action # v2.53.2
9297
uses: taiki-e/install-action@d12e869b89167df346dd0ff65da342d1fb1202fb
9398
with:

.github/workflows/build-v2.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
uses: ./.github/actions/common-setup
3737
with:
3838
python-version: "3.13"
39-
free-disk-space: "true"
39+
build-type: "pre-commit"
4040

4141
- name: Run pre-commit
4242
run: pre-commit run --all-files

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3232
with:
3333
python-version: "3.13"
34-
free-disk-space: "true"
34+
build-type: "pre-commit"
3535

3636
- name: Run pre-commit
3737
run: pre-commit run --all-files

0 commit comments

Comments
 (0)