1
0
mirror of https://github.com/j178/prek.git synced 2026-04-25 02:11:36 +02:00
Files
prek/.github/workflows/performance.yml
T
renovate[bot] 56f76237d6 Update GitHub Actions (major) (#1808)
This PR contains the following updates:

| Package | Type | Update | Change | Pending |
|---|---|---|---|---|
| [actions/cache](https://redirect.github.com/actions/cache) | action |
major | `v4.3.0` → `v5.0.3` | |
|
[actions/download-artifact](https://redirect.github.com/actions/download-artifact)
| action | major | `v7.0.0` → `v8.0.0` | `v8.0.1` |
|
[actions/upload-artifact](https://redirect.github.com/actions/upload-artifact)
| action | major | `v6.0.0` → `v7.0.0` | |
|
[docker/build-push-action](https://redirect.github.com/docker/build-push-action)
| action | major | `v6.19.2` → `v7.0.0` | |
| [docker/login-action](https://redirect.github.com/docker/login-action)
| action | major | `v3.7.0` → `v4.0.0` | |
|
[docker/metadata-action](https://redirect.github.com/docker/metadata-action)
| action | major | `v5.10.0` → `v6.0.0` | |
|
[docker/setup-buildx-action](https://redirect.github.com/docker/setup-buildx-action)
| action | major | `v3.12.0` → `v4.0.0` | |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the [Dependency
Dashboard](../issues/169) for more information.

---

### Release Notes

<details>
<summary>actions/cache (actions/cache)</summary>

###
[`v5.0.3`](https://redirect.github.com/actions/cache/releases/tag/v5.0.3)

[Compare
Source](https://redirect.github.com/actions/cache/compare/v5.0.2...v5.0.3)

##### What's Changed

- Bump `@actions/cache` to v5.0.5 (Resolves:
<https://github.com/actions/cache/security/dependabot/33>)
- Bump `@actions/core` to v2.0.3

**Full Changelog**:
<https://github.com/actions/cache/compare/v5...v5.0.3>

###
[`v5.0.2`](https://redirect.github.com/actions/cache/compare/v5.0.1...v5.0.2)

[Compare
Source](https://redirect.github.com/actions/cache/compare/v5.0.1...v5.0.2)

###
[`v5.0.1`](https://redirect.github.com/actions/cache/compare/v5.0.0...v5.0.1)

[Compare
Source](https://redirect.github.com/actions/cache/compare/v5.0.0...v5.0.1)

###
[`v5.0.0`](https://redirect.github.com/actions/cache/compare/v4.3.0...v5.0.0)

[Compare
Source](https://redirect.github.com/actions/cache/compare/v4.3.0...v5.0.0)

</details>

<details>
<summary>actions/download-artifact (actions/download-artifact)</summary>

###
[`v8.0.0`](https://redirect.github.com/actions/download-artifact/releases/tag/v8.0.0)

[Compare
Source](https://redirect.github.com/actions/download-artifact/compare/v7.0.0...v8.0.0)

##### v8 - What's new

##### Direct downloads

To support direct uploads in `actions/upload-artifact`, the action will
no longer attempt to unzip all downloaded files. Instead, the action
checks the `Content-Type` header ahead of unzipping and skips non-zipped
files. Callers wishing to download a zipped file as-is can also set the
new `skip-decompress` parameter to `false`.

##### Enforced checks (breaking)

A previous release introduced digest checks on the download. If a
download hash didn't match the expected hash from the server, the action
would log a warning. Callers can now configure the behavior on mismatch
with the `digest-mismatch` parameter. To be secure by default, we are
now defaulting the behavior to `error` which will fail the workflow run.

##### ESM

To support new versions of the @&#8203;actions/\* packages, we've
upgraded the package to ESM.

##### What's Changed

- Don't attempt to un-zip non-zipped downloads by
[@&#8203;danwkennedy](https://redirect.github.com/danwkennedy) in
[#&#8203;460](https://redirect.github.com/actions/download-artifact/pull/460)
- Add a setting to specify what to do on hash mismatch and default it to
`error` by
[@&#8203;danwkennedy](https://redirect.github.com/danwkennedy) in
[#&#8203;461](https://redirect.github.com/actions/download-artifact/pull/461)

**Full Changelog**:
<https://github.com/actions/download-artifact/compare/v7...v8.0.0>

</details>

<details>
<summary>actions/upload-artifact (actions/upload-artifact)</summary>

###
[`v7.0.0`](https://redirect.github.com/actions/upload-artifact/releases/tag/v7.0.0)

[Compare
Source](https://redirect.github.com/actions/upload-artifact/compare/v6.0.0...v7.0.0)

#### v7 What's new

##### Direct Uploads

Adds support for uploading single files directly (unzipped). Callers can
set the new `archive` parameter to `false` to skip zipping the file
during upload. Right now, we only support single files. The action will
fail if the glob passed resolves to multiple files. The `name` parameter
is also ignored with this setting. Instead, the name of the artifact
will be the name of the uploaded file.

##### ESM

To support new versions of the `@actions/*` packages, we've upgraded the
package to ESM.

#### What's Changed

- Add proxy integration test by
[@&#8203;Link-](https://redirect.github.com/Link-) in
[#&#8203;754](https://redirect.github.com/actions/upload-artifact/pull/754)
- Upgrade the module to ESM and bump dependencies by
[@&#8203;danwkennedy](https://redirect.github.com/danwkennedy) in
[#&#8203;762](https://redirect.github.com/actions/upload-artifact/pull/762)
- Support direct file uploads by
[@&#8203;danwkennedy](https://redirect.github.com/danwkennedy) in
[#&#8203;764](https://redirect.github.com/actions/upload-artifact/pull/764)

#### New Contributors

- [@&#8203;Link-](https://redirect.github.com/Link-) made their first
contribution in
[#&#8203;754](https://redirect.github.com/actions/upload-artifact/pull/754)

**Full Changelog**:
<https://github.com/actions/upload-artifact/compare/v6...v7.0.0>

</details>

<details>
<summary>docker/build-push-action (docker/build-push-action)</summary>

###
[`v7.0.0`](https://redirect.github.com/docker/build-push-action/releases/tag/v7.0.0)

[Compare
Source](https://redirect.github.com/docker/build-push-action/compare/v6.19.2...v7.0.0)

- Node 24 as default runtime (requires [Actions Runner
v2.327.1](https://redirect.github.com/actions/runner/releases/tag/v2.327.1)
or later) by [@&#8203;crazy-max](https://redirect.github.com/crazy-max)
in
[#&#8203;1470](https://redirect.github.com/docker/build-push-action/pull/1470)
- Remove deprecated `DOCKER_BUILD_NO_SUMMARY` and
`DOCKER_BUILD_EXPORT_RETENTION_DAYS` envs by
[@&#8203;crazy-max](https://redirect.github.com/crazy-max) in
[#&#8203;1473](https://redirect.github.com/docker/build-push-action/pull/1473)
- Remove legacy export-build tool support for build summary by
[@&#8203;crazy-max](https://redirect.github.com/crazy-max) in
[#&#8203;1474](https://redirect.github.com/docker/build-push-action/pull/1474)
- Switch to ESM and update config/test wiring by
[@&#8203;crazy-max](https://redirect.github.com/crazy-max) in
[#&#8203;1466](https://redirect.github.com/docker/build-push-action/pull/1466)
- Bump [@&#8203;actions/core](https://redirect.github.com/actions/core)
from 1.11.1 to 3.0.0 in
[#&#8203;1454](https://redirect.github.com/docker/build-push-action/pull/1454)
- Bump
[@&#8203;docker/actions-toolkit](https://redirect.github.com/docker/actions-toolkit)
from 0.62.1 to 0.79.0 in
[#&#8203;1453](https://redirect.github.com/docker/build-push-action/pull/1453)
[#&#8203;1472](https://redirect.github.com/docker/build-push-action/pull/1472)
[#&#8203;1479](https://redirect.github.com/docker/build-push-action/pull/1479)
- Bump minimatch from 3.1.2 to 3.1.5 in
[#&#8203;1463](https://redirect.github.com/docker/build-push-action/pull/1463)

**Full Changelog**:
<https://github.com/docker/build-push-action/compare/v6.19.2...v7.0.0>

</details>

<details>
<summary>docker/login-action (docker/login-action)</summary>

###
[`v4.0.0`](https://redirect.github.com/docker/login-action/releases/tag/v4.0.0)

[Compare
Source](https://redirect.github.com/docker/login-action/compare/v3.7.0...v4.0.0)

- Node 24 as default runtime (requires [Actions Runner
v2.327.1](https://redirect.github.com/actions/runner/releases/tag/v2.327.1)
or later) by [@&#8203;crazy-max](https://redirect.github.com/crazy-max)
in
[#&#8203;929](https://redirect.github.com/docker/login-action/pull/929)
- Switch to ESM and update config/test wiring by
[@&#8203;crazy-max](https://redirect.github.com/crazy-max) in
[#&#8203;927](https://redirect.github.com/docker/login-action/pull/927)
- Bump [@&#8203;actions/core](https://redirect.github.com/actions/core)
from 1.11.1 to 3.0.0 in
[#&#8203;919](https://redirect.github.com/docker/login-action/pull/919)
- Bump
[@&#8203;aws-sdk/client-ecr](https://redirect.github.com/aws-sdk/client-ecr)
from 3.890.0 to 3.1000.0 in
[#&#8203;909](https://redirect.github.com/docker/login-action/pull/909)
[#&#8203;920](https://redirect.github.com/docker/login-action/pull/920)
- Bump
[@&#8203;aws-sdk/client-ecr-public](https://redirect.github.com/aws-sdk/client-ecr-public)
from 3.890.0 to 3.1000.0 in
[#&#8203;909](https://redirect.github.com/docker/login-action/pull/909)
[#&#8203;920](https://redirect.github.com/docker/login-action/pull/920)
- Bump
[@&#8203;docker/actions-toolkit](https://redirect.github.com/docker/actions-toolkit)
from 0.63.0 to 0.77.0 in
[#&#8203;910](https://redirect.github.com/docker/login-action/pull/910)
[#&#8203;928](https://redirect.github.com/docker/login-action/pull/928)
- Bump
[@&#8203;isaacs/brace-expansion](https://redirect.github.com/isaacs/brace-expansion)
from 5.0.0 to 5.0.1 in
[#&#8203;921](https://redirect.github.com/docker/login-action/pull/921)
- Bump js-yaml from 4.1.0 to 4.1.1 in
[#&#8203;901](https://redirect.github.com/docker/login-action/pull/901)

**Full Changelog**:
<https://github.com/docker/login-action/compare/v3.7.0...v4.0.0>

</details>

<details>
<summary>docker/metadata-action (docker/metadata-action)</summary>

###
[`v6.0.0`](https://redirect.github.com/docker/metadata-action/releases/tag/v6.0.0)

[Compare
Source](https://redirect.github.com/docker/metadata-action/compare/v5.10.0...v6.0.0)

- Node 24 as default runtime (requires [Actions Runner
v2.327.1](https://redirect.github.com/actions/runner/releases/tag/v2.327.1)
or later) by [@&#8203;crazy-max](https://redirect.github.com/crazy-max)
in
[#&#8203;605](https://redirect.github.com/docker/metadata-action/pull/605)
- List inputs now preserve `#` inside values while still supporting
full-line `#` comments by
[@&#8203;crazy-max](https://redirect.github.com/crazy-max) in
[#&#8203;607](https://redirect.github.com/docker/metadata-action/pull/607)
- Switch to ESM and update config/test wiring by
[@&#8203;crazy-max](https://redirect.github.com/crazy-max) in
[#&#8203;602](https://redirect.github.com/docker/metadata-action/pull/602)
- Bump lodash from 4.17.21 to 4.17.23 in
[#&#8203;588](https://redirect.github.com/docker/metadata-action/pull/588)
- Bump [@&#8203;actions/core](https://redirect.github.com/actions/core)
from 1.11.1 to 3.0.0 in
[#&#8203;599](https://redirect.github.com/docker/metadata-action/pull/599)
- Bump
[@&#8203;actions/github](https://redirect.github.com/actions/github)
from 6.0.1 to 9.0.0 in
[#&#8203;597](https://redirect.github.com/docker/metadata-action/pull/597)
- Bump
[@&#8203;docker/actions-toolkit](https://redirect.github.com/docker/actions-toolkit)
from 0.68.0 to 0.79.0 in
[#&#8203;604](https://redirect.github.com/docker/metadata-action/pull/604)
- Bump
[@&#8203;isaacs/brace-expansion](https://redirect.github.com/isaacs/brace-expansion)
from 5.0.0 to 5.0.1 in
[#&#8203;600](https://redirect.github.com/docker/metadata-action/pull/600)
- Bump semver from 7.7.3 to 7.7.4 in
[#&#8203;603](https://redirect.github.com/docker/metadata-action/pull/603)

**Full Changelog**:
<https://github.com/docker/metadata-action/compare/v5.10.0...v6.0.0>

</details>

<details>
<summary>docker/setup-buildx-action
(docker/setup-buildx-action)</summary>

###
[`v4.0.0`](https://redirect.github.com/docker/setup-buildx-action/releases/tag/v4.0.0)

[Compare
Source](https://redirect.github.com/docker/setup-buildx-action/compare/v3.12.0...v4.0.0)

- Node 24 as default runtime (requires [Actions Runner
v2.327.1](https://redirect.github.com/actions/runner/releases/tag/v2.327.1)
or later) by [@&#8203;crazy-max](https://redirect.github.com/crazy-max)
in
[#&#8203;483](https://redirect.github.com/docker/setup-buildx-action/pull/483)
- Remove deprecated inputs/outputs by
[@&#8203;crazy-max](https://redirect.github.com/crazy-max) in
[#&#8203;464](https://redirect.github.com/docker/setup-buildx-action/pull/464)
- Switch to ESM and update config/test wiring by
[@&#8203;crazy-max](https://redirect.github.com/crazy-max) in
[#&#8203;481](https://redirect.github.com/docker/setup-buildx-action/pull/481)
- Bump [@&#8203;actions/core](https://redirect.github.com/actions/core)
from 1.11.1 to 3.0.0 in
[#&#8203;475](https://redirect.github.com/docker/setup-buildx-action/pull/475)
- Bump
[@&#8203;docker/actions-toolkit](https://redirect.github.com/docker/actions-toolkit)
from 0.63.0 to 0.79.0 in
[#&#8203;482](https://redirect.github.com/docker/setup-buildx-action/pull/482)
[#&#8203;485](https://redirect.github.com/docker/setup-buildx-action/pull/485)
- Bump js-yaml from 4.1.0 to 4.1.1 in
[#&#8203;452](https://redirect.github.com/docker/setup-buildx-action/pull/452)
- Bump lodash from 4.17.21 to 4.17.23 in
[#&#8203;472](https://redirect.github.com/docker/setup-buildx-action/pull/472)
- Bump minimatch from 3.1.2 to 3.1.5 in
[#&#8203;480](https://redirect.github.com/docker/setup-buildx-action/pull/480)

**Full Changelog**:
<https://github.com/docker/setup-buildx-action/compare/v3.12.0...v4.0.0>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Between 01:00 AM and 03:59 AM, only on
Monday ( * 1-3 * * 1 ) (UTC), Automerge - At any time (no schedule
defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config
help](https://redirect.github.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/j178/prek).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My42Ni40IiwidXBkYXRlZEluVmVyIjoiNDMuNjYuNCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciIsImxhYmVscyI6WyJpbnRlcm5hbCJdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-16 12:00:45 +08:00

172 lines
5.7 KiB
YAML

name: Performance
on:
workflow_call:
inputs:
save-rust-cache:
required: false
type: string
default: "true"
permissions: {}
env:
# Cargo env vars
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
CARGO_TERM_COLOR: always
RUSTUP_MAX_RETRIES: 10
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
bloat-check:
runs-on: ubuntu-latest
name: "bloat check"
timeout-minutes: 10
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
fetch-depth: 0
- uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1
- uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
with:
save-if: ${{ inputs.save-rust-cache == 'true' }}
- uses: taiki-e/install-action@a37010ded18ff788be4440302bd6830b1ae50d8b # v2.68.25
with:
tool: cargo-bloat
- name: Build head branch
id: bloat_head
run: |
# Build head branch
cargo bloat --release | tee bloat_head.txt >&1
- name: Checkout base
run: |
git checkout ${{ github.event.pull_request.base.sha }}
- name: Build base branch
id: bloat_base
run: |
# Build base branch
cargo bloat --release | tee bloat_base.txt >&1
- name: Compare bloat results
shell: python
run: |
import re
from pathlib import Path
def parse_size(text):
match = re.search(r'\.text section size.*?([\d.]+)\s*([KMGT]i?B)', text)
if not match:
raise ValueError("Could not find .text section size")
value, unit = float(match.group(1)), match.group(2)
multipliers = {'B': 1, 'KiB': 1024, 'MiB': 1024**2, 'GiB': 1024**3, 'TiB': 1024**4}
size = value * multipliers.get(unit, 1)
return size, f"{value} {unit}"
head_text = Path('bloat_head.txt').read_text()
base_text = Path('bloat_base.txt').read_text()
head_bytes, head_size = parse_size(head_text)
base_bytes, base_size = parse_size(base_text)
pct_change = ((head_bytes - base_bytes) / base_bytes) * 100
pct_display = f"{pct_change:+.2f}%"
comparison = f"""\
### 📦 Cargo Bloat Comparison
**Binary size change:** {pct_display} ({base_size} → {head_size})
<details>
<summary>Expand for cargo-bloat output</summary>
#### Head Branch Results
```
{head_text}
```
#### Base Branch Results
```
{base_text}
```
</details>
"""
Path("bloat-comparison.txt").write_text(comparison)
- name: Upload bloat results
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
# NOTE: https://github.com/j178/prek-ci-bot uses this artifact name to post comments on PRs.
# Make sure to update the bot if you rename the artifact.
name: bloat-check-results
path: bloat-comparison.txt
hyperfine-benchmark:
runs-on: ubuntu-latest
name: "hyperfine benchmark"
timeout-minutes: 10
env:
HYPERFINE_BENCHMARK_WORKSPACE: /tmp/prek-bench
HYPERFINE_BIN_DIR: ${{ github.workspace }}/.hyperfine-bin
HYPERFINE_RESULTS_FILE: ${{ github.workspace }}/hyperfine-benchmark.md
HYPERFINE_HEAD_BINARY: prek-head
HYPERFINE_BASE_BINARY: prek-base
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- name: Add hyperfine bin dir to PATH
run: |
mkdir -p "$HYPERFINE_BIN_DIR"
echo "$HYPERFINE_BIN_DIR" >> "$GITHUB_PATH"
- uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
with:
save-if: ${{ inputs.save-rust-cache == 'true' }}
- id: base-binary-cache
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
path: ${{ env.HYPERFINE_BIN_DIR }}/${{ env.HYPERFINE_BASE_BINARY }}
key: prek-hyperfine-base-${{ github.event.pull_request.base.sha }}-${{ hashFiles('Cargo.lock') }}-${{ runner.os }}-${{ runner.arch }}
- name: Build base version
if: ${{ steps.base-binary-cache.outputs.cache-hit != 'true' }}
env:
BASE_VERSION: ${{ github.event.pull_request.base.sha }}
run: |
git checkout ${{ github.event.pull_request.base.sha }}
cargo build --profile profiling && mv target/profiling/prek "$HYPERFINE_BIN_DIR/$HYPERFINE_BASE_BINARY"
git checkout ${{ github.sha }}
- name: Build head version
run: |
cargo build --profile profiling && mv target/profiling/prek "$HYPERFINE_BIN_DIR/$HYPERFINE_HEAD_BINARY"
- name: Install hyperfine
uses: taiki-e/install-action@a37010ded18ff788be4440302bd6830b1ae50d8b # v2.68.25
with:
tool: hyperfine
- name: Setup test environment for builtin hooks
run: scripts/hyperfine-setup-test-env.sh
- name: Run benchmarks
run: scripts/hyperfine-run-benchmarks.sh
- name: Upload benchmark results
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
# NOTE: https://github.com/j178/prek-ci-bot uses this artifact name to post comments on PRs.
# Make sure to update the bot if you rename the artifact.
name: hyperfine-benchmark-results
path: ${{ env.HYPERFINE_RESULTS_FILE }}