41 Commits

Author SHA1 Message Date
Arpad Borsos
c676846f29 2.9.0 2026-03-12 08:34:47 +01:00
Arpad Borsos
bf71d02c11 bump dependencies and rebuild 2026-03-12 08:27:56 +01:00
dependabot[bot]
8a02ed5e29 Bump @types/node from 25.0.2 to 25.2.2 in the dev-minor group (#309)
Bumps the dev-minor group with 1 update: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node).


Updates `@types/node` from 25.0.2 to 25.2.2
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 25.2.2
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: dev-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-11 11:20:49 +01:00
dependabot[bot]
390157d487 Bump the prd-minor group across 1 directory with 2 updates (#307)
Bumps the prd-minor group with 2 updates in the / directory: [@actions/glob](https://github.com/actions/toolkit/tree/HEAD/packages/glob) and [smol-toml](https://github.com/squirrelchat/smol-toml).


Updates `@actions/glob` from 0.5.0 to 0.6.1
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/glob/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/glob)

Updates `smol-toml` from 1.5.2 to 1.6.0
- [Release notes](https://github.com/squirrelchat/smol-toml/releases)
- [Commits](https://github.com/squirrelchat/smol-toml/compare/v1.5.2...v1.6.0)

---
updated-dependencies:
- dependency-name: "@actions/glob"
  dependency-version: 0.6.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prd-minor
- dependency-name: smol-toml
  dependency-version: 1.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prd-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-11 11:20:18 +01:00
dependabot[bot]
68500c182e Bump the actions group across 1 directory with 7 updates (#312)
Bumps the actions group with 7 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [actions/checkout](https://github.com/actions/checkout) | `6.0.1` | `6.0.2` |
| [actions/setup-node](https://github.com/actions/setup-node) | `6.1.0` | `6.2.0` |
| [actions/upload-artifact](https://github.com/actions/upload-artifact) | `6.0.0` | `7.0.0` |
| [taiki-e/install-action](https://github.com/taiki-e/install-action) | `2.63.3` | `2.68.16` |
| [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) | `2.4.0` | `2.5.0` |
| [cachix/install-nix-action](https://github.com/cachix/install-nix-action) | `31.9.0` | `31.9.1` |
| [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action) | `0.3.0` | `0.5.0` |



Updates `actions/checkout` from 6.0.1 to 6.0.2
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](8e8c483db8...de0fac2e45)

Updates `actions/setup-node` from 6.1.0 to 6.2.0
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](395ad32622...6044e13b5d)

Updates `actions/upload-artifact` from 6.0.0 to 7.0.0
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](b7c566a772...bbbca2ddaa)

Updates `taiki-e/install-action` from 2.63.3 to 2.68.16
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](d850aa8169...d6e286fa45)

Updates `dependabot/fetch-metadata` from 2.4.0 to 2.5.0
- [Release notes](https://github.com/dependabot/fetch-metadata/releases)
- [Commits](08eff52bf6...21025c705c)

Updates `cachix/install-nix-action` from 31.9.0 to 31.9.1
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Changelog](https://github.com/cachix/install-nix-action/blob/master/RELEASE.md)
- [Commits](4e002c8ec8...2126ae7fc5)

Updates `zizmorcore/zizmor-action` from 0.3.0 to 0.5.0
- [Release notes](https://github.com/zizmorcore/zizmor-action/releases)
- [Commits](e639db9933...0dce2577a4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: actions/setup-node
  dependency-version: 6.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: taiki-e/install-action
  dependency-version: 2.68.16
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: dependabot/fetch-metadata
  dependency-version: 2.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: cachix/install-nix-action
  dependency-version: 31.9.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: zizmorcore/zizmor-action
  dependency-version: 0.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-11 11:19:46 +01:00
Linda_pp
1a8384176d Migrate to node24 runner (#314) 2026-03-11 08:02:38 +01:00
Kieron Briggs
11da8522bc Compare case-insenitively for full cache key match (#303)
Some self-hosted (or otherwise non-github-hosted) runners are
non-case-preserving for cache keys. To support such configurations, set the
`cache-hit` output variable to `true` if the found cache key matches
case-insenitively.

Fixes: https://github.com/Swatinem/rust-cache/issues/302
2026-01-12 16:10:32 +01:00
Tamir Duberstein
5e4a767433 Consider all installed toolchains in cache key (#293) 2025-12-16 12:30:13 +01:00
dependabot[bot]
0aa729bb7a Bump @types/node from 24.10.1 to 25.0.2 in the dev-major group (#295)
Bumps the dev-major group with 1 update: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node).


Updates `@types/node` from 24.10.1 to 25.0.2
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 25.0.2
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: dev-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-16 11:55:53 +01:00
dependabot[bot]
6cda4ba16e Bump the prd-major group with 3 updates (#294)
Bumps the prd-major group with 3 updates: [@actions/cache](https://github.com/actions/toolkit/tree/HEAD/packages/cache), [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) and [@actions/exec](https://github.com/actions/toolkit/tree/HEAD/packages/exec).


Updates `@actions/cache` from 4.1.0 to 5.0.1
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/cache/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/cache)

Updates `@actions/core` from 1.11.1 to 2.0.1
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/@actions/artifact@2.0.1/packages/core)

Updates `@actions/exec` from 1.1.1 to 2.0.0
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/exec/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/exec)

---
updated-dependencies:
- dependency-name: "@actions/cache"
  dependency-version: 5.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: prd-major
- dependency-name: "@actions/core"
  dependency-version: 2.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: prd-major
- dependency-name: "@actions/exec"
  dependency-version: 2.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: prd-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-16 11:55:34 +01:00
dependabot[bot]
e73b99eeb0 Bump the actions group across 1 directory with 5 updates (#296)
Bumps the actions group with 5 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [actions/checkout](https://github.com/actions/checkout) | `6.0.0` | `6.0.1` |
| [actions/setup-node](https://github.com/actions/setup-node) | `6.0.0` | `6.1.0` |
| [actions/upload-artifact](https://github.com/actions/upload-artifact) | `5.0.0` | `6.0.0` |
| [taiki-e/install-action](https://github.com/taiki-e/install-action) | `2.62.60` | `2.63.3` |
| [cachix/install-nix-action](https://github.com/cachix/install-nix-action) | `31.8.4` | `31.9.0` |



Updates `actions/checkout` from 6.0.0 to 6.0.1
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](1af3b93b68...8e8c483db8)

Updates `actions/setup-node` from 6.0.0 to 6.1.0
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](2028fbc5c2...395ad32622)

Updates `actions/upload-artifact` from 5.0.0 to 6.0.0
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](330a01c490...b7c566a772)

Updates `taiki-e/install-action` from 2.62.60 to 2.63.3
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](3575e53270...d850aa8169)

Updates `cachix/install-nix-action` from 31.8.4 to 31.9.0
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Changelog](https://github.com/cachix/install-nix-action/blob/master/RELEASE.md)
- [Commits](0b0e072294...4e002c8ec8)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: actions/setup-node
  dependency-version: 6.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: actions/upload-artifact
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: taiki-e/install-action
  dependency-version: 2.63.3
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: cachix/install-nix-action
  dependency-version: 31.9.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-16 11:54:57 +01:00
github-actions[bot]
42c55942cf Merge pull request #291 from Swatinem/dependabot/github_actions/actions-d37c78095a
Bump taiki-e/install-action from 2.62.57 to 2.62.60 in the actions group
2025-12-02 01:11:03 +00:00
dependabot[bot]
73cfdf196a Bump taiki-e/install-action from 2.62.57 to 2.62.60 in the actions group
Bumps the actions group with 1 update: [taiki-e/install-action](https://github.com/taiki-e/install-action).


Updates `taiki-e/install-action` from 2.62.57 to 2.62.60
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](763e3324d4...3575e53270)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-version: 2.62.60
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-02 01:08:31 +00:00
marc0246
151eeee51b Add support for running rust-cache commands from within a Nix shell (#290) 2025-12-01 19:56:12 +01:00
Arpad Borsos
779680da71 2.8.2 2025-11-26 11:14:39 +01:00
dependabot[bot]
2ea64efb25 Bump smol-toml from 1.4.2 to 1.5.2 in the prd-minor group (#287)
Bumps the prd-minor group with 1 update: [smol-toml](https://github.com/squirrelchat/smol-toml).


Updates `smol-toml` from 1.4.2 to 1.5.2
- [Release notes](https://github.com/squirrelchat/smol-toml/releases)
- [Commits](https://github.com/squirrelchat/smol-toml/compare/v1.4.2...v1.5.2)

---
updated-dependencies:
- dependency-name: smol-toml
  dependency-version: 1.5.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prd-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-26 11:02:27 +01:00
dependabot[bot]
8930d9c33e Bump the actions group with 3 updates (#288)
Bumps the actions group with 3 updates: [actions/checkout](https://github.com/actions/checkout), [taiki-e/install-action](https://github.com/taiki-e/install-action) and [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action).


Updates `actions/checkout` from 5.0.1 to 6.0.0
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](93cb6efe18...1af3b93b68)

Updates `taiki-e/install-action` from 2.62.52 to 2.62.57
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](537c30d2b4...763e3324d4)

Updates `zizmorcore/zizmor-action` from 0.2.0 to 0.3.0
- [Release notes](https://github.com/zizmorcore/zizmor-action/releases)
- [Commits](e673c3917a...e639db9933)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: taiki-e/install-action
  dependency-version: 2.62.57
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: zizmorcore/zizmor-action
  dependency-version: 0.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-26 11:01:55 +01:00
dependabot[bot]
c071727fc9 Bump @actions/io from 1.1.3 to 2.0.0 in the prd-major group (#281)
Bumps the prd-major group with 1 update: [@actions/io](https://github.com/actions/toolkit/tree/HEAD/packages/io).


Updates `@actions/io` from 1.1.3 to 2.0.0
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/io/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/io)

---
updated-dependencies:
- dependency-name: "@actions/io"
  dependency-version: 2.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: prd-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-18 21:03:14 +01:00
dependabot[bot]
f2a41b7c11 Bump @types/node from 24.9.0 to 24.10.0 in the dev-minor group (#282)
Bumps the dev-minor group with 1 update: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node).


Updates `@types/node` from 24.9.0 to 24.10.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 24.10.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: dev-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-18 21:02:55 +01:00
MaeIsBad
e306f83d21 Don't overwrite env for cargo-metadata call (#285)
In some cases(eg. if RUST_TOOLCHAIN is set and cargo
is managed by rustup) cargo metadata will behave
incorrectly if some environment variables are removed
2025-11-18 21:02:38 +01:00
github-actions[bot]
c9119007a1 Merge pull request #284 from Swatinem/dependabot/github_actions/actions-baeb0db19e
Bump the actions group with 2 updates
2025-11-17 21:42:38 +00:00
dependabot[bot]
3aaed5547e Bump the actions group with 2 updates
Bumps the actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [taiki-e/install-action](https://github.com/taiki-e/install-action).


Updates `actions/checkout` from 5.0.0 to 5.0.1
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](08c6903cd8...93cb6efe18)

Updates `taiki-e/install-action` from 2.62.49 to 2.62.52
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](44c6d64aa6...537c30d2b4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 5.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: taiki-e/install-action
  dependency-version: 2.62.52
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-17 21:38:22 +00:00
github-actions[bot]
972b315a82 Merge pull request #283 from Swatinem/dependabot/github_actions/actions-b360d03232
Bump taiki-e/install-action from 2.62.45 to 2.62.49 in the actions group
2025-11-10 21:55:25 +00:00
dependabot[bot]
07caf06f7a Bump taiki-e/install-action from 2.62.45 to 2.62.49 in the actions group
Bumps the actions group with 1 update: [taiki-e/install-action](https://github.com/taiki-e/install-action).


Updates `taiki-e/install-action` from 2.62.45 to 2.62.49
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](81ee1d48d9...44c6d64aa6)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-version: 2.62.49
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-10 21:51:22 +00:00
github-actions[bot]
a84bfdc502 Merge pull request #280 from Swatinem/dependabot/github_actions/actions-8e9a2844ee
Bump taiki-e/install-action from 2.62.39 to 2.62.45 in the actions group
2025-11-03 21:31:17 +00:00
dependabot[bot]
7ec422fc69 Bump taiki-e/install-action from 2.62.39 to 2.62.45 in the actions group
Bumps the actions group with 1 update: [taiki-e/install-action](https://github.com/taiki-e/install-action).


Updates `taiki-e/install-action` from 2.62.39 to 2.62.45
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](0ed4032d54...81ee1d48d9)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-version: 2.62.45
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-03 21:30:52 +00:00
dependabot[bot]
b28feea9c9 Bump the actions group across 1 directory with 3 updates (#278)
Bumps the actions group with 3 updates in the / directory: [actions/setup-node](https://github.com/actions/setup-node), [actions/upload-artifact](https://github.com/actions/upload-artifact) and [taiki-e/install-action](https://github.com/taiki-e/install-action).


Updates `actions/setup-node` from 5.0.0 to 6.0.0
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](a0853c2454...2028fbc5c2)

Updates `actions/upload-artifact` from 4.6.2 to 5.0.0
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](ea165f8d65...330a01c490)

Updates `taiki-e/install-action` from 2.62.28 to 2.62.39
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](e7ef886cf8...0ed4032d54)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/upload-artifact
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: taiki-e/install-action
  dependency-version: 2.62.39
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-03 14:24:31 +01:00
dependabot[bot]
54f69366a5 Bump @types/node from 24.7.0 to 24.9.0 in the dev-minor group (#275)
Bumps the dev-minor group with 1 update: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node).


Updates `@types/node` from 24.7.0 to 24.9.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 24.9.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: dev-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-03 14:24:15 +01:00
Ryan Brice
27f6075dd2 feat: Implement ability to disable adding job ID + rust environment hashes to cache names (#279) 2025-11-03 14:24:00 +01:00
github-actions[bot]
94162284cf Merge pull request #274 from Swatinem/dependabot/github_actions/actions-c5e17773d5
Bump taiki-e/install-action from 2.62.21 to 2.62.28 in the actions group
2025-10-13 21:43:39 +00:00
dependabot[bot]
2245981121 Bump taiki-e/install-action from 2.62.21 to 2.62.28 in the actions group
Bumps the actions group with 1 update: [taiki-e/install-action](https://github.com/taiki-e/install-action).


Updates `taiki-e/install-action` from 2.62.21 to 2.62.28
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](522492a8c1...e7ef886cf8)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-version: 2.62.28
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-13 21:42:16 +00:00
dependabot[bot]
51dda28b91 Bump @types/node from 24.6.0 to 24.7.0 in the dev-minor group (#270)
Bumps the dev-minor group with 1 update: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node).


Updates `@types/node` from 24.6.0 to 24.7.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 24.7.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: dev-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-07 10:27:30 +02:00
dependabot[bot]
20d8423432 Bump typescript from 5.9.2 to 5.9.3 in the dev-patch group (#269)
Bumps the dev-patch group with 1 update: [typescript](https://github.com/microsoft/TypeScript).


Updates `typescript` from 5.9.2 to 5.9.3
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release-publish.yml)
- [Commits](https://github.com/microsoft/TypeScript/compare/v5.9.2...v5.9.3)

---
updated-dependencies:
- dependency-name: typescript
  dependency-version: 5.9.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-07 10:27:15 +02:00
github-actions[bot]
b08fc8f955 Merge pull request #271 from Swatinem/dependabot/github_actions/actions-7807ab0a6b
Bump taiki-e/install-action from 2.62.13 to 2.62.21 in the actions group
2025-10-06 21:50:57 +00:00
dependabot[bot]
bf8c594800 Bump taiki-e/install-action from 2.62.13 to 2.62.21 in the actions group
Bumps the actions group with 1 update: [taiki-e/install-action](https://github.com/taiki-e/install-action).


Updates `taiki-e/install-action` from 2.62.13 to 2.62.21
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](d0f4f69b07...522492a8c1)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-version: 2.62.21
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-06 21:36:06 +00:00
dependabot[bot]
a1f94902a6 Bump @types/node from 24.5.2 to 24.6.0 in the dev-minor group (#266)
Bumps the dev-minor group with 1 update: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node).


Updates `@types/node` from 24.5.2 to 24.6.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 24.6.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: dev-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-30 10:51:28 +02:00
dependabot[bot]
eb57cd6af8 Bump @actions/cache from 4.0.5 to 4.1.0 in the prd-minor group (#267)
Bumps the prd-minor group with 1 update: [@actions/cache](https://github.com/actions/toolkit/tree/HEAD/packages/cache).


Updates `@actions/cache` from 4.0.5 to 4.1.0
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/cache/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/cache)

---
updated-dependencies:
- dependency-name: "@actions/cache"
  dependency-version: 4.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: prd-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-30 10:51:16 +02:00
github-actions[bot]
90fd0618bc Merge pull request #265 from Swatinem/dependabot/github_actions/actions-da6a7eb2aa
Bump taiki-e/install-action from 2.62.2 to 2.62.13 in the actions group
2025-09-29 22:41:21 +00:00
dependabot[bot]
2a0d153b42 Bump taiki-e/install-action from 2.62.2 to 2.62.13 in the actions group
Bumps the actions group with 1 update: [taiki-e/install-action](https://github.com/taiki-e/install-action).


Updates `taiki-e/install-action` from 2.62.2 to 2.62.13
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](cd39cb0572...d0f4f69b07)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-version: 2.62.13
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-29 22:38:46 +00:00
dependabot[bot]
14cb63c99f Bump @vercel/ncc from 0.38.3 to 0.38.4 (#263)
Bumps [@vercel/ncc](https://github.com/vercel/ncc) from 0.38.3 to 0.38.4.
- [Release notes](https://github.com/vercel/ncc/releases)
- [Commits](https://github.com/vercel/ncc/compare/0.38.3...0.38.4)

---
updated-dependencies:
- dependency-name: "@vercel/ncc"
  dependency-version: 0.38.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-23 09:12:11 +02:00
William Woodruff
7bd5339b5b ci: address lint findings, add zizmor workflow (#262) 2025-09-23 09:11:49 +02:00
26 changed files with 239785 additions and 37217 deletions

View File

@@ -2,6 +2,8 @@ name: buildjet
on: [push, pull_request] on: [push, pull_request]
permissions: {}
jobs: jobs:
buildjet: buildjet:
if: github.repository == 'Swatinem/rust-cache' if: github.repository == 'Swatinem/rust-cache'
@@ -17,7 +19,9 @@ jobs:
CARGO_TERM_COLOR: always CARGO_TERM_COLOR: always
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- run: rustup toolchain install stable --profile minimal --no-self-update - run: rustup toolchain install stable --profile minimal --no-self-update

View File

@@ -11,17 +11,21 @@ on:
- "**.md" - "**.md"
workflow_dispatch: workflow_dispatch:
permissions: {}
jobs: jobs:
check-dist: check-dist:
if: github.repository == 'Swatinem/rust-cache' if: github.repository == 'Swatinem/rust-cache'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Node.js 20.x
uses: actions/setup-node@v5
with: with:
node-version: 20.x persist-credentials: false
- name: Setup Node.js 24.x
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: 24.x
cache: npm cache: npm
- name: Install dependencies - name: Install dependencies
@@ -39,7 +43,7 @@ jobs:
fi fi
id: diff id: diff
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
if: ${{ failure() && steps.diff.conclusion == 'failure' }} if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with: with:
name: dist name: dist

View File

@@ -2,6 +2,8 @@ name: coverage
on: [push, pull_request] on: [push, pull_request]
permissions: {}
jobs: jobs:
coverage: coverage:
if: github.repository == 'Swatinem/rust-cache' if: github.repository == 'Swatinem/rust-cache'
@@ -17,11 +19,15 @@ jobs:
CARGO_TERM_COLOR: always CARGO_TERM_COLOR: always
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- run: rustup toolchain install stable --profile minimal --component llvm-tools-preview --no-self-update - run: rustup toolchain install stable --profile minimal --component llvm-tools-preview --no-self-update
- uses: taiki-e/install-action@cargo-llvm-cov - uses: taiki-e/install-action@64c5c20c872907b6f7cd50994ac189e7274160f2 # v2.68.26
with:
tool: cargo-llvm-cov
- uses: ./ - uses: ./
with: with:

View File

@@ -3,23 +3,25 @@
name: Dependabot Automation name: Dependabot Automation
on: pull_request on: pull_request
permissions: permissions: {}
contents: write
pull-requests: write
jobs: jobs:
automerge: automerge:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions:
contents: write # for pushing commits
pull-requests: write # for merging PRs
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'Swatinem/rust-cache' if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'Swatinem/rust-cache'
steps: steps:
- name: Fetch metadata - name: Fetch metadata
id: metadata id: metadata
uses: dependabot/fetch-metadata@v2 uses: dependabot/fetch-metadata@21025c705c08248db411dc16f3619e6b5f9ea21a # v2.5.0
with: with:
github-token: "${{ secrets.GITHUB_TOKEN }}" github-token: "${{ secrets.GITHUB_TOKEN }}"
- uses: actions/checkout@v5 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with: with:
fetch-depth: 2 fetch-depth: 2
persist-credentials: false
if: steps.metadata.outputs.update-type == 'version-update:semver-patch' if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
- name: Check if package-lock.json has been changed - name: Check if package-lock.json has been changed
if: steps.metadata.outputs.update-type == 'version-update:semver-patch' if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
@@ -35,9 +37,9 @@ jobs:
fi fi
- name: Setup node if necessary - name: Setup node if necessary
if: steps.npm.outputs.changed != '' if: steps.npm.outputs.changed != ''
uses: actions/setup-node@v5 uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with: with:
node-version: 20.x node-version: 24.x
cache: npm cache: npm
- name: Re-generate and commit dist/ if changed - name: Re-generate and commit dist/ if changed
id: amend id: amend

View File

@@ -2,6 +2,8 @@ name: git-registry
on: [push, pull_request] on: [push, pull_request]
permissions: {}
jobs: jobs:
git-registry: git-registry:
if: github.repository == 'Swatinem/rust-cache' if: github.repository == 'Swatinem/rust-cache'
@@ -18,7 +20,9 @@ jobs:
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: git CARGO_REGISTRIES_CRATES_IO_PROTOCOL: git
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- run: rustup toolchain install stable --profile minimal --no-self-update - run: rustup toolchain install stable --profile minimal --no-self-update

View File

@@ -2,6 +2,8 @@ name: install
on: [push, pull_request] on: [push, pull_request]
permissions: {}
jobs: jobs:
install: install:
if: github.repository == 'Swatinem/rust-cache' if: github.repository == 'Swatinem/rust-cache'
@@ -17,7 +19,9 @@ jobs:
CARGO_TERM_COLOR: always CARGO_TERM_COLOR: always
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- run: rustup toolchain install stable --profile minimal --no-self-update - run: rustup toolchain install stable --profile minimal --no-self-update

74
.github/workflows/multi-job-cache.yml vendored Normal file
View File

@@ -0,0 +1,74 @@
name: multi-job-cache
on: [push, pull_request]
permissions: {}
jobs:
multi-job-cache-1:
if: github.repository == 'Swatinem/rust-cache'
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
name: Test multi-job cache (1) on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
CARGO_TERM_COLOR: always
steps:
- name: checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: install rust toolchain
run: rustup toolchain install stable --profile minimal --target wasm32-unknown-unknown --no-self-update
- name: cache
uses: ./
with:
workspaces: |
tests
add-job-id-key: "false"
add-rust-environment-hash-key: "false"
- name: cargo check (tests)
working-directory: tests
run: cargo check
multi-job-cache-2:
if: github.repository == 'Swatinem/rust-cache'
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
name: Test multi-job cache (2) on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
CARGO_TERM_COLOR: always
steps:
- name: checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: install rust toolchain
run: rustup toolchain install stable --profile minimal --target wasm32-unknown-unknown --no-self-update
- name: cache
uses: ./
with:
workspaces: |
tests/wasm-workspace
add-job-id-key: "false"
add-rust-environment-hash-key: "false"
- name: cargo check (tests/wasm-workspace)
working-directory: tests/wasm-workspace
run: cargo check

33
.github/workflows/nix.yml vendored Normal file
View File

@@ -0,0 +1,33 @@
name: nix
on: [push, pull_request]
permissions: {}
jobs:
nix:
if: github.repository == 'Swatinem/rust-cache'
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
name: Test Nix on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: cachix/install-nix-action@1ca7d21a94afc7c957383a2d217460d980de4934 # v31.10.1
- uses: ./
with:
workspaces: tests
cmd-format: nix develop ./tests -c {0}
- run: |
nix develop -c cargo check
nix develop -c cargo test
working-directory: tests

View File

@@ -2,6 +2,8 @@ name: simple
on: [push, pull_request] on: [push, pull_request]
permissions: {}
jobs: jobs:
simple: simple:
if: github.repository == 'Swatinem/rust-cache' if: github.repository == 'Swatinem/rust-cache'
@@ -17,7 +19,9 @@ jobs:
CARGO_TERM_COLOR: always CARGO_TERM_COLOR: always
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- run: rustup toolchain install stable --profile minimal --no-self-update - run: rustup toolchain install stable --profile minimal --no-self-update

View File

@@ -2,6 +2,8 @@ name: target-dir
on: [push, pull_request] on: [push, pull_request]
permissions: {}
jobs: jobs:
target-dir: target-dir:
if: github.repository == 'Swatinem/rust-cache' if: github.repository == 'Swatinem/rust-cache'
@@ -17,7 +19,9 @@ jobs:
CARGO_TERM_COLOR: always CARGO_TERM_COLOR: always
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- run: rustup toolchain install stable --profile minimal --no-self-update - run: rustup toolchain install stable --profile minimal --no-self-update

View File

@@ -2,6 +2,8 @@ name: workspaces
on: [push, pull_request] on: [push, pull_request]
permissions: {}
jobs: jobs:
workspaces: workspaces:
if: github.repository == 'Swatinem/rust-cache' if: github.repository == 'Swatinem/rust-cache'
@@ -17,7 +19,9 @@ jobs:
CARGO_TERM_COLOR: always CARGO_TERM_COLOR: always
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- run: rustup toolchain install stable --profile minimal --target wasm32-unknown-unknown --no-self-update - run: rustup toolchain install stable --profile minimal --target wasm32-unknown-unknown --no-self-update

24
.github/workflows/zizmor.yml vendored Normal file
View File

@@ -0,0 +1,24 @@
name: GitHub Actions Security Analysis with zizmor 🌈
on:
push:
branches: ["main"]
pull_request:
branches: ["**"]
permissions: {}
jobs:
zizmor:
name: Run zizmor 🌈
runs-on: ubuntu-latest
permissions:
security-events: write # for uploading results to the Security tab
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Run zizmor 🌈
uses: zizmorcore/zizmor-action@71321a20a9ded102f6e9ce5718a2fcec2c4f70d8 # v0.5.2

1
.gitignore vendored
View File

@@ -1,5 +1,6 @@
node_modules/ node_modules/
target/ target/
src/*.js
# Editors # Editors
.idea/ .idea/

View File

@@ -1,5 +1,9 @@
# Changelog # Changelog
## 2.8.2
- Don't overwrite env for cargo-metadata call
## 2.8.1 ## 2.8.1
- Set empty `CARGO_ENCODED_RUSTFLAGS` when retrieving metadata - Set empty `CARGO_ENCODED_RUSTFLAGS` when retrieving metadata

View File

@@ -28,6 +28,16 @@ sensible defaults.
# default: empty # default: empty
key: "" key: ""
# If the automatic `job`-based cache key should include the job id.
# default: "true"
add-job-id-key: ""
# Weather the a hash of the rust environment should be included in the cache key.
# This includes a hash of all Cargo.toml/Cargo.lock files, rust-toolchain files,
# and .cargo/config.toml files (if present), as well as the specified 'env-vars'.
# default: "true"
add-rust-environment-hash-key: ""
# A whitespace separated list of env-var *prefixes* who's value contributes # A whitespace separated list of env-var *prefixes* who's value contributes
# to the environment cache key. # to the environment cache key.
# The env-vars are matched by *prefix*, so the default `RUST` var will # The env-vars are matched by *prefix*, so the default `RUST` var will
@@ -89,6 +99,16 @@ sensible defaults.
# Determines whether to cache the ~/.cargo/bin directory. # Determines whether to cache the ~/.cargo/bin directory.
# default: "true" # default: "true"
cache-bin: "" cache-bin: ""
# A format string used to format commands to be run, i.e. `rustc` and `cargo`.
# Must contain exactly one occurance of `{0}`, which is the formatting fragment
# that will be replaced with the `rustc` or `cargo` command. This is necessary
# when using Nix or other setup that requires running these commands within a
# specific shell, otherwise the system `rustc` and `cargo` will be run.
# default: "{0}"
cmd-format: ""
# To run within a Nix shell (using the default dev shell of a flake in the repo root):
cmd-format: nix develop -c {0}
``` ```
Further examples are available in the [.github/workflows](./.github/workflows/) directory. Further examples are available in the [.github/workflows](./.github/workflows/) directory.
@@ -121,12 +141,15 @@ This action currently caches the following files/directories:
This cache is automatically keyed by: This cache is automatically keyed by:
- the github [`job_id`](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_id), - the github [`job_id`](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_id)
- the rustc release / host / hash, (if `add-job-id-key` is `"true"`),
- the value of some compiler-specific environment variables (eg. RUSTFLAGS, etc), and - the rustc release / host / hash (for all installed toolchains when
- a hash of all `Cargo.lock` / `Cargo.toml` files found anywhere in the repository (if present). available),
- a hash of all `rust-toolchain` / `rust-toolchain.toml` files in the root of the repository (if present). - the following values, if `add-rust-environment-hash-key` is `"true"`:
- a hash of all `.cargo/config.toml` files in the root of the repository (if present). - the value of some compiler-specific environment variables (eg. RUSTFLAGS, etc), and
- a hash of all `Cargo.lock` / `Cargo.toml` files found anywhere in the repository (if present).
- a hash of all `rust-toolchain` / `rust-toolchain.toml` files in the root of the repository (if present).
- a hash of all `.cargo/config.toml` files in the root of the repository (if present).
An additional input `key` can be provided if the builtin keys are not sufficient. An additional input `key` can be provided if the builtin keys are not sufficient.

View File

@@ -12,6 +12,14 @@ inputs:
key: key:
description: "An additional cache key that is added alongside the automatic `job`-based cache key and can be used to further differentiate jobs." description: "An additional cache key that is added alongside the automatic `job`-based cache key and can be used to further differentiate jobs."
required: false required: false
add-job-id-key:
description: "If the automatic `job`-based cache key should include the job id. Defaults to true."
required: false
default: "true"
add-rust-environment-hash-key:
description: "Weather the a hash of the rust environment should be included in the cache key. This includes a hash of all Cargo.toml/Cargo.lock files, rust-toolchain files, and .cargo/config.toml files (if present), as well as the specified 'env-vars'. Defaults to true."
required: false
default: "true"
env-vars: env-vars:
description: "Additional environment variables to include in the cache key, separated by spaces." description: "Additional environment variables to include in the cache key, separated by spaces."
required: false required: false
@@ -52,11 +60,15 @@ inputs:
description: "Check if a cache entry exists without downloading the cache" description: "Check if a cache entry exists without downloading the cache"
required: false required: false
default: "false" default: "false"
cmd-format:
description: "A format string used to format commands to be run, i.e. `rustc` and `cargo`."
required: false
default: "{0}"
outputs: outputs:
cache-hit: cache-hit:
description: "A boolean value that indicates an exact match was found." description: "A boolean value that indicates an exact match was found."
runs: runs:
using: "node20" using: "node24"
main: "dist/restore/index.js" main: "dist/restore/index.js"
post: "dist/save/index.js" post: "dist/save/index.js"
post-if: "success() || env.CACHE_ON_FAILURE == 'true'" post-if: "success() || env.CACHE_ON_FAILURE == 'true'"

132197
dist/restore/index.js vendored

File diff suppressed because one or more lines are too long

132227
dist/save/index.js vendored

File diff suppressed because one or more lines are too long

364
package-lock.json generated
View File

@@ -1,28 +1,28 @@
{ {
"name": "rust-cache", "name": "rust-cache",
"version": "2.8.1", "version": "2.9.0",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "rust-cache", "name": "rust-cache",
"version": "2.8.1", "version": "2.9.0",
"license": "LGPL-3.0", "license": "LGPL-3.0",
"dependencies": { "dependencies": {
"@actions/buildjet-cache": "npm:github-actions.cache-buildjet@0.2.0", "@actions/buildjet-cache": "npm:github-actions.cache-buildjet@0.2.0",
"@actions/cache": "^4.0.5", "@actions/cache": "^6.0.0",
"@actions/core": "^1.11.1", "@actions/core": "^3.0.0",
"@actions/exec": "^1.1.1", "@actions/exec": "^3.0.0",
"@actions/glob": "^0.5.0", "@actions/glob": "^0.6.1",
"@actions/io": "^1.1.3", "@actions/io": "^3.0.2",
"@actions/warpbuild-cache": "npm:github-actions.warp-cache@1.4.7", "@actions/warpbuild-cache": "npm:github-actions.warp-cache@1.4.7",
"smol-toml": "^1.4.2" "smol-toml": "^1.6.0"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^24.3.0", "@types/node": "^25.4.0",
"@vercel/ncc": "^0.38.3", "@vercel/ncc": "^0.38.4",
"linefix": "^0.1.1", "linefix": "^0.1.1",
"typescript": "5.9.2" "typescript": "5.9.3"
}, },
"funding": { "funding": {
"url": "https://github.com/sponsors/Swatinem" "url": "https://github.com/sponsors/Swatinem"
@@ -43,6 +43,23 @@
"uuid": "^3.3.3" "uuid": "^3.3.3"
} }
}, },
"node_modules/@actions/buildjet-cache/node_modules/@actions/core": {
"version": "1.11.1",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.11.1.tgz",
"integrity": "sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==",
"dependencies": {
"@actions/exec": "^1.1.1",
"@actions/http-client": "^2.0.1"
}
},
"node_modules/@actions/buildjet-cache/node_modules/@actions/exec": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.1.tgz",
"integrity": "sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==",
"dependencies": {
"@actions/io": "^1.0.1"
}
},
"node_modules/@actions/buildjet-cache/node_modules/@actions/glob": { "node_modules/@actions/buildjet-cache/node_modules/@actions/glob": {
"version": "0.1.2", "version": "0.1.2",
"resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.1.2.tgz", "resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.1.2.tgz",
@@ -52,47 +69,87 @@
"minimatch": "^3.0.4" "minimatch": "^3.0.4"
} }
}, },
"node_modules/@actions/buildjet-cache/node_modules/@actions/io": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz",
"integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q=="
},
"node_modules/@actions/cache": { "node_modules/@actions/cache": {
"version": "4.0.5", "version": "6.0.0",
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-4.0.5.tgz", "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-6.0.0.tgz",
"integrity": "sha512-RjLz1/vvntOfp3FpkY3wB0MjVRbLq7bfQEuQG9UUTKwdtcYmFrKVmuD+9B6ADbzbkSfHM+dM4sMjdr3R4XIkFg==", "integrity": "sha512-+tCs634SyGBQJ3KU1rtAVabmN/gYiT9WgzTSJzWwdPCLmM3zWrdbysaErKv8HyI6OozClrxNvDgPjJimbHZZvw==",
"dependencies": { "dependencies": {
"@actions/core": "^1.11.1", "@actions/core": "^3.0.0",
"@actions/exec": "^1.0.1", "@actions/exec": "^3.0.0",
"@actions/glob": "^0.1.0", "@actions/glob": "^0.6.1",
"@actions/http-client": "^2.1.1", "@actions/http-client": "^4.0.0",
"@actions/io": "^1.0.1", "@actions/io": "^3.0.0",
"@azure/abort-controller": "^1.1.0", "@azure/core-rest-pipeline": "^1.22.0",
"@azure/ms-rest-js": "^2.6.0", "@azure/storage-blob": "^12.30.0",
"@azure/storage-blob": "^12.13.0",
"@protobuf-ts/runtime-rpc": "^2.11.1", "@protobuf-ts/runtime-rpc": "^2.11.1",
"semver": "^6.3.1" "semver": "^7.7.3"
} }
}, },
"node_modules/@actions/cache/node_modules/@actions/glob": { "node_modules/@actions/cache/node_modules/@actions/http-client": {
"version": "0.1.2", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.1.2.tgz", "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-4.0.0.tgz",
"integrity": "sha512-SclLR7Ia5sEqjkJTPs7Sd86maMDw43p769YxBOxvPvEWuPEhpAnBsQfENOpXjFYMmhCqd127bmf+YdvJqVqR4A==", "integrity": "sha512-QuwPsgVMsD6qaPD57GLZi9sqzAZCtiJT8kVBCDpLtxhL5MydQ4gS+DrejtZZPdIYyB1e95uCK9Luyds7ybHI3g==",
"dependencies": { "dependencies": {
"@actions/core": "^1.2.6", "tunnel": "^0.0.6",
"minimatch": "^3.0.4" "undici": "^6.23.0"
}
},
"node_modules/@actions/cache/node_modules/semver": {
"version": "7.7.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz",
"integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==",
"bin": {
"semver": "bin/semver.js"
},
"engines": {
"node": ">=10"
}
},
"node_modules/@actions/cache/node_modules/undici": {
"version": "6.23.0",
"resolved": "https://registry.npmjs.org/undici/-/undici-6.23.0.tgz",
"integrity": "sha512-VfQPToRA5FZs/qJxLIinmU59u0r7LXqoJkCzinq3ckNJp3vKEh7jTWN589YQ5+aoAC/TGRLyJLCPKcLQbM8r9g==",
"engines": {
"node": ">=18.17"
} }
}, },
"node_modules/@actions/core": { "node_modules/@actions/core": {
"version": "1.11.1", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.11.1.tgz", "resolved": "https://registry.npmjs.org/@actions/core/-/core-3.0.0.tgz",
"integrity": "sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==", "integrity": "sha512-zYt6cz+ivnTmiT/ksRVriMBOiuoUpDCJJlZ5KPl2/FRdvwU3f7MPh9qftvbkXJThragzUZieit2nyHUyw53Seg==",
"dependencies": { "dependencies": {
"@actions/exec": "^1.1.1", "@actions/exec": "^3.0.0",
"@actions/http-client": "^2.0.1" "@actions/http-client": "^4.0.0"
}
},
"node_modules/@actions/core/node_modules/@actions/http-client": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-4.0.0.tgz",
"integrity": "sha512-QuwPsgVMsD6qaPD57GLZi9sqzAZCtiJT8kVBCDpLtxhL5MydQ4gS+DrejtZZPdIYyB1e95uCK9Luyds7ybHI3g==",
"dependencies": {
"tunnel": "^0.0.6",
"undici": "^6.23.0"
}
},
"node_modules/@actions/core/node_modules/undici": {
"version": "6.23.0",
"resolved": "https://registry.npmjs.org/undici/-/undici-6.23.0.tgz",
"integrity": "sha512-VfQPToRA5FZs/qJxLIinmU59u0r7LXqoJkCzinq3ckNJp3vKEh7jTWN589YQ5+aoAC/TGRLyJLCPKcLQbM8r9g==",
"engines": {
"node": ">=18.17"
} }
}, },
"node_modules/@actions/exec": { "node_modules/@actions/exec": {
"version": "1.1.1", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.1.tgz", "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-3.0.0.tgz",
"integrity": "sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==", "integrity": "sha512-6xH/puSoNBXb72VPlZVm7vQ+svQpFyA96qdDBvhB8eNZOE8LtPf9L4oAsfzK/crCL8YZ+19fKYVnM63Sl+Xzlw==",
"dependencies": { "dependencies": {
"@actions/io": "^1.0.1" "@actions/io": "^3.0.2"
} }
}, },
"node_modules/@actions/github": { "node_modules/@actions/github": {
@@ -110,11 +167,11 @@
} }
}, },
"node_modules/@actions/glob": { "node_modules/@actions/glob": {
"version": "0.5.0", "version": "0.6.1",
"resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.5.0.tgz", "resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.6.1.tgz",
"integrity": "sha512-tST2rjPvJLRZLuT9NMUtyBjvj9Yo0MiJS3ow004slMvm8GFM+Zv9HvMJ7HWzfUyJnGrJvDsYkWBaaG3YKXRtCw==", "integrity": "sha512-K4+2Ac5ILcf2ySdJCha+Pop9NcKjxqCL4xL4zI50dgB2PbXgC0+AcP011xfH4Of6b4QEJJg8dyZYv7zl4byTsw==",
"dependencies": { "dependencies": {
"@actions/core": "^1.9.1", "@actions/core": "^3.0.0",
"minimatch": "^3.0.4" "minimatch": "^3.0.4"
} }
}, },
@@ -128,9 +185,9 @@
} }
}, },
"node_modules/@actions/io": { "node_modules/@actions/io": {
"version": "1.1.3", "version": "3.0.2",
"resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz", "resolved": "https://registry.npmjs.org/@actions/io/-/io-3.0.2.tgz",
"integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q==" "integrity": "sha512-nRBchcMM+QK1pdjO7/idu86rbJI5YHUKCvKs0KxnSYbVe3F51UfGxuZX4Qy/fWlp6l7gWFwIkrOzN+oUK03kfw=="
}, },
"node_modules/@actions/warpbuild-cache": { "node_modules/@actions/warpbuild-cache": {
"name": "github-actions.warp-cache", "name": "github-actions.warp-cache",
@@ -155,6 +212,23 @@
"uuid": "^3.3.3" "uuid": "^3.3.3"
} }
}, },
"node_modules/@actions/warpbuild-cache/node_modules/@actions/core": {
"version": "1.11.1",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.11.1.tgz",
"integrity": "sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==",
"dependencies": {
"@actions/exec": "^1.1.1",
"@actions/http-client": "^2.0.1"
}
},
"node_modules/@actions/warpbuild-cache/node_modules/@actions/exec": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.1.tgz",
"integrity": "sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==",
"dependencies": {
"@actions/io": "^1.0.1"
}
},
"node_modules/@actions/warpbuild-cache/node_modules/@actions/glob": { "node_modules/@actions/warpbuild-cache/node_modules/@actions/glob": {
"version": "0.1.2", "version": "0.1.2",
"resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.1.2.tgz", "resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.1.2.tgz",
@@ -164,6 +238,11 @@
"minimatch": "^3.0.4" "minimatch": "^3.0.4"
} }
}, },
"node_modules/@actions/warpbuild-cache/node_modules/@actions/io": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz",
"integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q=="
},
"node_modules/@azure/abort-controller": { "node_modules/@azure/abort-controller": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-1.1.0.tgz", "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-1.1.0.tgz",
@@ -228,16 +307,18 @@
} }
}, },
"node_modules/@azure/core-http-compat": { "node_modules/@azure/core-http-compat": {
"version": "2.3.1", "version": "2.3.2",
"resolved": "https://registry.npmjs.org/@azure/core-http-compat/-/core-http-compat-2.3.1.tgz", "resolved": "https://registry.npmjs.org/@azure/core-http-compat/-/core-http-compat-2.3.2.tgz",
"integrity": "sha512-az9BkXND3/d5VgdRRQVkiJb2gOmDU8Qcq4GvjtBmDICNiQ9udFmDk4ZpSB5Qq1OmtDJGlQAfBaS4palFsazQ5g==", "integrity": "sha512-Tf6ltdKzOJEgxZeWLCjMxrxbodB/ZeCbzzA1A2qHbhzAjzjHoBVSUeSl/baT/oHAxhc4qdqVaDKnc2+iE932gw==",
"dependencies": { "dependencies": {
"@azure/abort-controller": "^2.1.2", "@azure/abort-controller": "^2.1.2"
"@azure/core-client": "^1.10.0",
"@azure/core-rest-pipeline": "^1.22.0"
}, },
"engines": { "engines": {
"node": ">=20.0.0" "node": ">=20.0.0"
},
"peerDependencies": {
"@azure/core-client": "^1.10.0",
"@azure/core-rest-pipeline": "^1.22.0"
} }
}, },
"node_modules/@azure/core-http-compat/node_modules/@azure/abort-controller": { "node_modules/@azure/core-http-compat/node_modules/@azure/abort-controller": {
@@ -288,16 +369,16 @@
} }
}, },
"node_modules/@azure/core-rest-pipeline": { "node_modules/@azure/core-rest-pipeline": {
"version": "1.22.1", "version": "1.23.0",
"resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.22.1.tgz", "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.23.0.tgz",
"integrity": "sha512-UVZlVLfLyz6g3Hy7GNDpooMQonUygH7ghdiSASOOHy97fKj/mPLqgDX7aidOijn+sCMU+WU8NjlPlNTgnvbcGA==", "integrity": "sha512-Evs1INHo+jUjwHi1T6SG6Ua/LHOQBCLuKEEE6efIpt4ZOoNonaT1kP32GoOcdNDbfqsD2445CPri3MubBy5DEQ==",
"dependencies": { "dependencies": {
"@azure/abort-controller": "^2.1.2", "@azure/abort-controller": "^2.1.2",
"@azure/core-auth": "^1.10.0", "@azure/core-auth": "^1.10.0",
"@azure/core-tracing": "^1.3.0", "@azure/core-tracing": "^1.3.0",
"@azure/core-util": "^1.13.0", "@azure/core-util": "^1.13.0",
"@azure/logger": "^1.3.0", "@azure/logger": "^1.3.0",
"@typespec/ts-http-runtime": "^0.3.0", "@typespec/ts-http-runtime": "^0.3.4",
"tslib": "^2.6.2" "tslib": "^2.6.2"
}, },
"engines": { "engines": {
@@ -403,9 +484,9 @@
} }
}, },
"node_modules/@azure/storage-blob": { "node_modules/@azure/storage-blob": {
"version": "12.28.0", "version": "12.31.0",
"resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.28.0.tgz", "resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.31.0.tgz",
"integrity": "sha512-VhQHITXXO03SURhDiGuHhvc/k/sD2WvJUS7hqhiVNbErVCuQoLtWql7r97fleBlIRKHJaa9R7DpBjfE0pfLYcA==", "integrity": "sha512-DBgNv10aCSxopt92DkTDD0o9xScXeBqPKGmR50FPZQaEcH4JLQ+GEOGEDv19V5BMkB7kxr+m4h6il/cCDPvmHg==",
"dependencies": { "dependencies": {
"@azure/abort-controller": "^2.1.2", "@azure/abort-controller": "^2.1.2",
"@azure/core-auth": "^1.9.0", "@azure/core-auth": "^1.9.0",
@@ -418,7 +499,7 @@
"@azure/core-util": "^1.11.0", "@azure/core-util": "^1.11.0",
"@azure/core-xml": "^1.4.5", "@azure/core-xml": "^1.4.5",
"@azure/logger": "^1.1.4", "@azure/logger": "^1.1.4",
"@azure/storage-common": "^12.0.0-beta.2", "@azure/storage-common": "^12.3.0",
"events": "^3.0.0", "events": "^3.0.0",
"tslib": "^2.8.1" "tslib": "^2.8.1"
}, },
@@ -438,9 +519,9 @@
} }
}, },
"node_modules/@azure/storage-common": { "node_modules/@azure/storage-common": {
"version": "12.0.0", "version": "12.3.0",
"resolved": "https://registry.npmjs.org/@azure/storage-common/-/storage-common-12.0.0.tgz", "resolved": "https://registry.npmjs.org/@azure/storage-common/-/storage-common-12.3.0.tgz",
"integrity": "sha512-QyEWXgi4kdRo0wc1rHum9/KnaWZKCdQGZK1BjU4fFL6Jtedp7KLbQihgTTVxldFy1z1ZPtuDPx8mQ5l3huPPbA==", "integrity": "sha512-/OFHhy86aG5Pe8dP5tsp+BuJ25JOAl9yaMU3WZbkeoiFMHFtJ7tu5ili7qEdBXNW9G5lDB19trwyI6V49F/8iQ==",
"dependencies": { "dependencies": {
"@azure/abort-controller": "^2.1.2", "@azure/abort-controller": "^2.1.2",
"@azure/core-auth": "^1.9.0", "@azure/core-auth": "^1.9.0",
@@ -504,9 +585,9 @@
} }
}, },
"node_modules/@google-cloud/storage": { "node_modules/@google-cloud/storage": {
"version": "7.17.1", "version": "7.19.0",
"resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-7.17.1.tgz", "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-7.19.0.tgz",
"integrity": "sha512-2FMQbpU7qK+OtBPaegC6n+XevgZksobUGo6mGKnXNmeZpvLiAo1gTAE3oTKsrMGDV4VtL8Zzpono0YsK/Q7Iqg==", "integrity": "sha512-n2FjE7NAOYyshogdc7KQOl/VZb4sneqPjWouSyia9CMDdMhRX5+RIbqalNmC7LOLzuLAN89VlF2HvG8na9G+zQ==",
"dependencies": { "dependencies": {
"@google-cloud/paginator": "^5.0.0", "@google-cloud/paginator": "^5.0.0",
"@google-cloud/projectify": "^4.0.0", "@google-cloud/projectify": "^4.0.0",
@@ -514,7 +595,7 @@
"abort-controller": "^3.0.0", "abort-controller": "^3.0.0",
"async-retry": "^1.3.3", "async-retry": "^1.3.3",
"duplexify": "^4.1.3", "duplexify": "^4.1.3",
"fast-xml-parser": "^4.4.1", "fast-xml-parser": "^5.3.4",
"gaxios": "^6.0.2", "gaxios": "^6.0.2",
"google-auth-library": "^9.6.3", "google-auth-library": "^9.6.3",
"html-entities": "^2.5.2", "html-entities": "^2.5.2",
@@ -528,34 +609,6 @@
"node": ">=14" "node": ">=14"
} }
}, },
"node_modules/@google-cloud/storage/node_modules/fast-xml-parser": {
"version": "4.5.3",
"resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.5.3.tgz",
"integrity": "sha512-RKihhV+SHsIUGXObeVy9AXiBbFwkVk7Syp8XgwN5U3JV416+Gwp/GO9i0JYKmikykgz/UHRrrV4ROuZEo/T0ig==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/NaturalIntelligence"
}
],
"dependencies": {
"strnum": "^1.1.1"
},
"bin": {
"fxparser": "src/cli/cli.js"
}
},
"node_modules/@google-cloud/storage/node_modules/strnum": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/strnum/-/strnum-1.1.2.tgz",
"integrity": "sha512-vrN+B7DBIoTTZjnPNewwhx6cBA/H+IS7rfW68n7XxC1y7uoiGQBxaKzqucGUgavX15dJgiGztLJ8vxuEzwqBdA==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/NaturalIntelligence"
}
]
},
"node_modules/@google-cloud/storage/node_modules/uuid": { "node_modules/@google-cloud/storage/node_modules/uuid": {
"version": "8.3.2", "version": "8.3.2",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
@@ -741,11 +794,11 @@
"integrity": "sha512-hWtVTC2q7hc7xZ/RLbxapMvDMgUnDvKvMOpKal4DrMyfGBUfB1oKaZlIRr6mJL+If3bAP6sV/QneGzF6tJjZDg==" "integrity": "sha512-hWtVTC2q7hc7xZ/RLbxapMvDMgUnDvKvMOpKal4DrMyfGBUfB1oKaZlIRr6mJL+If3bAP6sV/QneGzF6tJjZDg=="
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "24.5.2", "version": "25.4.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.5.2.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-25.4.0.tgz",
"integrity": "sha512-FYxk1I7wPv3K2XBaoyH2cTnocQEu8AOZ60hPbsyukMPLv5/5qr7V1i8PLHdl6Zf87I+xZXFvPCXYjiTFq+YSDQ==", "integrity": "sha512-9wLpoeWuBlcbBpOY3XmzSTG3oscB6xjBEEtn+pYXTfhyXhIxC5FsBer2KTopBlvKEiW9l13po9fq+SJY/5lkhw==",
"dependencies": { "dependencies": {
"undici-types": "~7.12.0" "undici-types": "~7.18.0"
} }
}, },
"node_modules/@types/request": { "node_modules/@types/request": {
@@ -765,9 +818,9 @@
"integrity": "sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==" "integrity": "sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA=="
}, },
"node_modules/@typespec/ts-http-runtime": { "node_modules/@typespec/ts-http-runtime": {
"version": "0.3.1", "version": "0.3.4",
"resolved": "https://registry.npmjs.org/@typespec/ts-http-runtime/-/ts-http-runtime-0.3.1.tgz", "resolved": "https://registry.npmjs.org/@typespec/ts-http-runtime/-/ts-http-runtime-0.3.4.tgz",
"integrity": "sha512-SnbaqayTVFEA6/tYumdF0UmybY0KHyKwGPBXnyckFlrrKdhWFrL3a2HIPXHjht5ZOElKGcXfD2D63P36btb+ww==", "integrity": "sha512-CI0NhTrz4EBaa0U+HaaUZrJhPoso8sG7ZFya8uQoBA57fjzrjRSv87ekCjLZOFExN+gXE/z0xuN2QfH4H2HrLQ==",
"dependencies": { "dependencies": {
"http-proxy-agent": "^7.0.0", "http-proxy-agent": "^7.0.0",
"https-proxy-agent": "^7.0.0", "https-proxy-agent": "^7.0.0",
@@ -778,9 +831,9 @@
} }
}, },
"node_modules/@vercel/ncc": { "node_modules/@vercel/ncc": {
"version": "0.38.3", "version": "0.38.4",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.38.3.tgz", "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.38.4.tgz",
"integrity": "sha512-rnK6hJBS6mwc+Bkab+PGPs9OiS0i/3kdTO+CkI8V0/VrW3vmz7O2Pxjw/owOlmo6PKEIxRSeZKv/kuL9itnpYA==", "integrity": "sha512-8LwjnlP39s08C08J5NstzriPvW1SP8Zfpp1BvC2sI35kPeZnHfxVkCwu4/+Wodgnd60UtT1n8K8zw+Mp7J9JmQ==",
"dev": true, "dev": true,
"bin": { "bin": {
"ncc": "dist/ncc/cli.js" "ncc": "dist/ncc/cli.js"
@@ -827,19 +880,19 @@
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
}, },
"node_modules/axios": { "node_modules/axios": {
"version": "1.12.2", "version": "1.13.6",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.12.2.tgz", "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.6.tgz",
"integrity": "sha512-vMJzPewAlRyOgxV2dU0Cuz2O8zzzx9VYtbJOaBgXFeLc4IV/Eg50n4LowmehOOR61S8ZMpc2K5Sa7g6A4jfkUw==", "integrity": "sha512-ChTCHMouEe2kn713WHbQGcuYrr6fXTBiu460OTwWrWob16g1bXn4vtz07Ope7ewMozJAnEquLk5lWQWtBig9DQ==",
"dependencies": { "dependencies": {
"follow-redirects": "^1.15.6", "follow-redirects": "^1.15.11",
"form-data": "^4.0.4", "form-data": "^4.0.5",
"proxy-from-env": "^1.1.0" "proxy-from-env": "^1.1.0"
} }
}, },
"node_modules/axios/node_modules/form-data": { "node_modules/axios/node_modules/form-data": {
"version": "4.0.4", "version": "4.0.5",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz",
"integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==", "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==",
"dependencies": { "dependencies": {
"asynckit": "^0.4.0", "asynckit": "^0.4.0",
"combined-stream": "^1.0.8", "combined-stream": "^1.0.8",
@@ -1061,10 +1114,10 @@
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
"integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="
}, },
"node_modules/fast-xml-parser": { "node_modules/fast-xml-builder": {
"version": "5.2.5", "version": "1.1.2",
"resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.2.5.tgz", "resolved": "https://registry.npmjs.org/fast-xml-builder/-/fast-xml-builder-1.1.2.tgz",
"integrity": "sha512-pfX9uG9Ki0yekDHx2SiuRIyFdyAr1kMIMitPvb0YBo8SUfKvia7w7FIyd/l6av85pFYRhZscS75MwMnbvY+hcQ==", "integrity": "sha512-NJAmiuVaJEjVa7TjLZKlYd7RqmzOC91EtPFXHvlTcqBVo50Qh7XV5IwvXi1c7NRz2Q/majGX9YLcwJtWgHjtkA==",
"funding": [ "funding": [
{ {
"type": "github", "type": "github",
@@ -1072,7 +1125,23 @@
} }
], ],
"dependencies": { "dependencies": {
"strnum": "^2.1.0" "path-expression-matcher": "^1.1.3"
}
},
"node_modules/fast-xml-parser": {
"version": "5.5.3",
"resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.5.3.tgz",
"integrity": "sha512-Ymnuefk6VzAhT3SxLzVUw+nMio/wB1NGypHkgetwtXcK1JfryaHk4DWQFGVwQ9XgzyS5iRZ7C2ZGI4AMsdMZ6A==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/NaturalIntelligence"
}
],
"dependencies": {
"fast-xml-builder": "^1.1.2",
"path-expression-matcher": "^1.1.3",
"strnum": "^2.1.2"
}, },
"bin": { "bin": {
"fxparser": "src/cli/cli.js" "fxparser": "src/cli/cli.js"
@@ -1353,11 +1422,11 @@
} }
}, },
"node_modules/jws": { "node_modules/jws": {
"version": "4.0.0", "version": "4.0.1",
"resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.1.tgz",
"integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", "integrity": "sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA==",
"dependencies": { "dependencies": {
"jwa": "^2.0.0", "jwa": "^2.0.1",
"safe-buffer": "^5.0.1" "safe-buffer": "^5.0.1"
} }
}, },
@@ -1409,9 +1478,9 @@
} }
}, },
"node_modules/minimatch": { "node_modules/minimatch": {
"version": "3.1.2", "version": "3.1.5",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz",
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==",
"dependencies": { "dependencies": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
}, },
@@ -1465,6 +1534,20 @@
"url": "https://github.com/sponsors/sindresorhus" "url": "https://github.com/sponsors/sindresorhus"
} }
}, },
"node_modules/path-expression-matcher": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/path-expression-matcher/-/path-expression-matcher-1.1.3.tgz",
"integrity": "sha512-qdVgY8KXmVdJZRSS1JdEPOKPdTiEK/pi0RkcT2sw1RhXxohdujUlJFPuS1TSkevZ9vzd3ZlL7ULl1MHGTApKzQ==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/NaturalIntelligence"
}
],
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/proxy-from-env": { "node_modules/proxy-from-env": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
@@ -1524,9 +1607,12 @@
] ]
}, },
"node_modules/sax": { "node_modules/sax": {
"version": "1.4.1", "version": "1.5.0",
"resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz", "resolved": "https://registry.npmjs.org/sax/-/sax-1.5.0.tgz",
"integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==" "integrity": "sha512-21IYA3Q5cQf089Z6tgaUTr7lDAyzoTPx5HRtbhsME8Udispad8dC/+sziTNugOEx54ilvatQ9YCzl4KQLPcRHA==",
"engines": {
"node": ">=11.0.0"
}
}, },
"node_modules/semver": { "node_modules/semver": {
"version": "6.3.1", "version": "6.3.1",
@@ -1537,9 +1623,9 @@
} }
}, },
"node_modules/smol-toml": { "node_modules/smol-toml": {
"version": "1.4.2", "version": "1.6.0",
"resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.4.2.tgz", "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.6.0.tgz",
"integrity": "sha512-rInDH6lCNiEyn3+hH8KVGFdbjc099j47+OSgbMrfDYX1CmXLfdKd7qi6IfcWj2wFxvSVkuI46M+wPGYfEOEj6g==", "integrity": "sha512-4zemZi0HvTnYwLfrpk/CF9LOd9Lt87kAt50GnqhMpyF9U3poDAP2+iukq2bZsO/ufegbYehBkqINbsWxj4l4cw==",
"engines": { "engines": {
"node": ">= 18" "node": ">= 18"
}, },
@@ -1569,9 +1655,9 @@
} }
}, },
"node_modules/strnum": { "node_modules/strnum": {
"version": "2.1.1", "version": "2.2.0",
"resolved": "https://registry.npmjs.org/strnum/-/strnum-2.1.1.tgz", "resolved": "https://registry.npmjs.org/strnum/-/strnum-2.2.0.tgz",
"integrity": "sha512-7ZvoFTiCnGxBtDqJ//Cu6fWtZtc7Y3x+QOirG15wztbdngGSkht27o2pyGWrVy0b4WAy3jbKmnoK6g5VlVNUUw==", "integrity": "sha512-Y7Bj8XyJxnPAORMZj/xltsfo55uOiyHcU2tnAVzHUnSJR/KsEX+9RoDeXEnsXtl/CX4fAcrt64gZ13aGaWPeBg==",
"funding": [ "funding": [
{ {
"type": "github", "type": "github",
@@ -1666,9 +1752,9 @@
} }
}, },
"node_modules/typescript": { "node_modules/typescript": {
"version": "5.9.2", "version": "5.9.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.2.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
"integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==", "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
"dev": true, "dev": true,
"bin": { "bin": {
"tsc": "bin/tsc", "tsc": "bin/tsc",
@@ -1690,9 +1776,9 @@
} }
}, },
"node_modules/undici-types": { "node_modules/undici-types": {
"version": "7.12.0", "version": "7.18.2",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.12.0.tgz", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz",
"integrity": "sha512-goOacqME2GYyOZZfb5Lgtu+1IDmAlAEu5xnD3+xTzS10hT0vzpf0SPjkXwAw9Jm+4n/mQGDP3LO8CPbYROeBfQ==" "integrity": "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w=="
}, },
"node_modules/universal-user-agent": { "node_modules/universal-user-agent": {
"version": "6.0.1", "version": "6.0.1",

View File

@@ -1,7 +1,7 @@
{ {
"private": true, "private": true,
"name": "rust-cache", "name": "rust-cache",
"version": "2.8.1", "version": "2.9.0",
"description": "A GitHub Action that implements smart caching for rust/cargo projects with sensible defaults.", "description": "A GitHub Action that implements smart caching for rust/cargo projects with sensible defaults.",
"keywords": [ "keywords": [
"actions", "actions",
@@ -24,18 +24,18 @@
"dependencies": { "dependencies": {
"@actions/buildjet-cache": "npm:github-actions.cache-buildjet@0.2.0", "@actions/buildjet-cache": "npm:github-actions.cache-buildjet@0.2.0",
"@actions/warpbuild-cache": "npm:github-actions.warp-cache@1.4.7", "@actions/warpbuild-cache": "npm:github-actions.warp-cache@1.4.7",
"@actions/cache": "^4.0.5", "@actions/cache": "^6.0.0",
"@actions/core": "^1.11.1", "@actions/core": "^3.0.0",
"@actions/exec": "^1.1.1", "@actions/exec": "^3.0.0",
"@actions/glob": "^0.5.0", "@actions/glob": "^0.6.1",
"@actions/io": "^1.1.3", "@actions/io": "^3.0.2",
"smol-toml": "^1.4.2" "smol-toml": "^1.6.0"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^24.3.0", "@types/node": "^25.4.0",
"@vercel/ncc": "^0.38.3", "@vercel/ncc": "^0.38.4",
"linefix": "^0.1.1", "linefix": "^0.1.1",
"typescript": "5.9.2" "typescript": "5.9.3"
}, },
"scripts": { "scripts": {
"prepare": "ncc build --target es2020 -o dist/restore src/restore.ts && ncc build --target es2020 -o dist/save src/save.ts && linefix dist" "prepare": "ncc build --target es2020 -o dist/restore src/restore.ts && ncc build --target es2020 -o dist/save src/save.ts && linefix dist"

View File

@@ -1,8 +1,9 @@
import * as core from "@actions/core"; import * as core from "@actions/core";
import * as glob from "@actions/glob"; import * as glob from "@actions/glob";
import crypto from "crypto"; import crypto from "crypto";
import fs from "fs"; import fs from "fs/promises";
import fs_promises from "fs/promises"; import { createReadStream } from "fs";
import { pipeline } from "stream/promises";
import os from "os"; import os from "os";
import path from "path"; import path from "path";
import * as toml from "smol-toml"; import * as toml from "smol-toml";
@@ -18,6 +19,9 @@ const STATE_CONFIG = "RUST_CACHE_CONFIG";
const HASH_LENGTH = 8; const HASH_LENGTH = 8;
export class CacheConfig { export class CacheConfig {
/** A format string for running commands */
public cmdFormat: string = "";
/** All the paths we want to cache */ /** All the paths we want to cache */
public cachePaths: Array<string> = []; public cachePaths: Array<string> = [];
/** The primary cache key */ /** The primary cache key */
@@ -37,7 +41,7 @@ export class CacheConfig {
/** The prefix portion of the cache key */ /** The prefix portion of the cache key */
private keyPrefix = ""; private keyPrefix = "";
/** The rust version considered for the cache key */ /** The rust version considered for the cache key */
private keyRust = ""; private keyRust: Array<string> = [];
/** The environment variables considered for the cache key */ /** The environment variables considered for the cache key */
private keyEnvs: Array<string> = []; private keyEnvs: Array<string> = [];
/** The files considered for the cache key */ /** The files considered for the cache key */
@@ -53,6 +57,17 @@ export class CacheConfig {
static async new(): Promise<CacheConfig> { static async new(): Promise<CacheConfig> {
const self = new CacheConfig(); const self = new CacheConfig();
let cmdFormat = core.getInput("cmd-format");
if (cmdFormat) {
const placeholderMatches = cmdFormat.match(/\{0\}/g);
if (!placeholderMatches || placeholderMatches.length !== 1) {
cmdFormat = "{0}";
}
} else {
cmdFormat = "{0}";
}
self.cmdFormat = cmdFormat;
// Construct key prefix: // Construct key prefix:
// This uses either the `shared-key` input, // This uses either the `shared-key` input,
// or the `key` input combined with the `job` key. // or the `key` input combined with the `job` key.
@@ -69,7 +84,7 @@ export class CacheConfig {
} }
const job = process.env.GITHUB_JOB; const job = process.env.GITHUB_JOB;
if (job) { if ((job) && core.getInput("add-job-id-key").toLowerCase() == "true") {
key += `-${job}`; key += `-${job}`;
} }
} }
@@ -89,14 +104,16 @@ export class CacheConfig {
// resulting environment hash. // resulting environment hash.
let hasher = crypto.createHash("sha1"); let hasher = crypto.createHash("sha1");
const rustVersion = await getRustVersion(); const rustVersions = Array.from(await getRustVersions(cmdFormat));
// Doesn't matter how they're sorted, just as long as it's deterministic.
rustVersions.sort();
let keyRust = `${rustVersion.release} ${rustVersion.host}`; for (const rustVersion of rustVersions) {
const { release, host, "commit-hash": commitHash } = rustVersion;
const keyRust = `${release} ${host} ${commitHash}`;
hasher.update(keyRust); hasher.update(keyRust);
hasher.update(rustVersion["commit-hash"]); self.keyRust.push(keyRust);
}
keyRust += ` (${rustVersion["commit-hash"]})`;
self.keyRust = keyRust;
// these prefixes should cover most of the compiler / rust / cargo keys // these prefixes should cover most of the compiler / rust / cargo keys
const envPrefixes = ["CARGO", "CC", "CFLAGS", "CXX", "CMAKE", "RUST"]; const envPrefixes = ["CARGO", "CC", "CFLAGS", "CXX", "CMAKE", "RUST"];
@@ -116,7 +133,10 @@ export class CacheConfig {
self.keyEnvs = keyEnvs; self.keyEnvs = keyEnvs;
// Add job hash suffix if 'add-rust-environment-hash-key' is true
if (core.getInput("add-rust-environment-hash-key").toLowerCase() == "true") {
key += `-${digest(hasher)}`; key += `-${digest(hasher)}`;
}
self.restoreKey = key; self.restoreKey = key;
@@ -139,6 +159,9 @@ export class CacheConfig {
} }
self.workspaces = workspaces; self.workspaces = workspaces;
// Add hash suffix of all rust environment lockfiles + manifests if
// 'add-rust-environment-hash-key' is true
if (core.getInput("add-rust-environment-hash-key").toLowerCase() == "true") {
let keyFiles = await globFiles(".cargo/config.toml\nrust-toolchain\nrust-toolchain.toml"); let keyFiles = await globFiles(".cargo/config.toml\nrust-toolchain\nrust-toolchain.toml");
const parsedKeyFiles = []; // keyFiles that are parsed, pre-processed and hashed const parsedKeyFiles = []; // keyFiles that are parsed, pre-processed and hashed
@@ -152,13 +175,13 @@ export class CacheConfig {
)), )),
); );
const workspaceMembers = await workspace.getWorkspaceMembers(); const workspaceMembers = await workspace.getWorkspaceMembers(cmdFormat);
const cargo_manifests = sort_and_uniq(workspaceMembers.map((member) => path.join(member.path, "Cargo.toml"))); const cargo_manifests = sort_and_uniq(workspaceMembers.map((member) => path.join(member.path, "Cargo.toml")));
for (const cargo_manifest of cargo_manifests) { for (const cargo_manifest of cargo_manifests) {
try { try {
const content = await fs_promises.readFile(cargo_manifest, { encoding: "utf8" }); const content = await fs.readFile(cargo_manifest, { encoding: "utf8" });
// Use any since TomlPrimitive is not exposed // Use any since TomlPrimitive is not exposed
const parsed = toml.parse(content) as { [key: string]: any }; const parsed = toml.parse(content) as { [key: string]: any };
@@ -205,7 +228,7 @@ export class CacheConfig {
const cargo_lock = path.join(workspace.root, "Cargo.lock"); const cargo_lock = path.join(workspace.root, "Cargo.lock");
if (await exists(cargo_lock)) { if (await exists(cargo_lock)) {
try { try {
const content = await fs_promises.readFile(cargo_lock, { encoding: "utf8" }); const content = await fs.readFile(cargo_lock, { encoding: "utf8" });
const parsed = toml.parse(content); const parsed = toml.parse(content);
if ((parsed.version !== 3 && parsed.version !== 4) || !("package" in parsed)) { if ((parsed.version !== 3 && parsed.version !== 4) || !("package" in parsed)) {
@@ -233,17 +256,16 @@ export class CacheConfig {
keyFiles = sort_and_uniq(keyFiles); keyFiles = sort_and_uniq(keyFiles);
for (const file of keyFiles) { for (const file of keyFiles) {
for await (const chunk of fs.createReadStream(file)) { await pipeline(createReadStream(file), hasher);
hasher.update(chunk);
} }
}
let lockHash = digest(hasher);
keyFiles.push(...parsedKeyFiles); keyFiles.push(...parsedKeyFiles);
self.keyFiles = sort_and_uniq(keyFiles); self.keyFiles = sort_and_uniq(keyFiles);
let lockHash = digest(hasher);
key += `-${lockHash}`; key += `-${lockHash}`;
}
self.cacheKey = key; self.cacheKey = key;
self.cachePaths = [path.join(CARGO_HOME, "registry"), path.join(CARGO_HOME, "git")]; self.cachePaths = [path.join(CARGO_HOME, "registry"), path.join(CARGO_HOME, "git")];
@@ -314,7 +336,10 @@ export class CacheConfig {
core.info(`.. Prefix:`); core.info(`.. Prefix:`);
core.info(` - ${this.keyPrefix}`); core.info(` - ${this.keyPrefix}`);
core.info(`.. Environment considered:`); core.info(`.. Environment considered:`);
core.info(` - Rust Version: ${this.keyRust}`); core.info(` - Rust Versions:`);
for (const rust of this.keyRust) {
core.info(` - ${rust}`);
}
for (const env of this.keyEnvs) { for (const env of this.keyEnvs) {
core.info(` - ${env}`); core.info(` - ${env}`);
} }
@@ -359,9 +384,33 @@ interface RustVersion {
"commit-hash": string; "commit-hash": string;
} }
async function getRustVersion(): Promise<RustVersion> { async function getRustVersions(cmdFormat: string): Promise<Set<RustVersion>> {
const stdout = await getCmdOutput("rustc", ["-vV"]); const versions = new Set<RustVersion>();
let splits = stdout
versions.add(parseRustVersion(await getCmdOutput(cmdFormat, "rustc -vV")));
const stdout = await (async () => {
try {
return await getCmdOutput(cmdFormat, "rustup toolchain list --quiet");
} catch (e) {
core.warning(`Error running rustup toolchain list, falling back to default toolchain only: ${e}`);
return undefined;
}
})();
if (stdout !== undefined) {
for (const toolchain of stdout.split(/[\n\r]+/)) {
const trimmed = toolchain.trim();
if (!trimmed) {
continue;
}
versions.add(parseRustVersion(await getCmdOutput(cmdFormat, `rustup run ${toolchain} rustc -vV`)));
}
}
return versions;
}
function parseRustVersion(stdout: string): RustVersion {
const splits = stdout
.split(/[\n\r]+/) .split(/[\n\r]+/)
.filter(Boolean) .filter(Boolean)
.map((s) => s.split(":").map((s) => s.trim())) .map((s) => s.split(":").map((s) => s.trim()))
@@ -373,10 +422,17 @@ async function globFiles(pattern: string): Promise<string[]> {
const globber = await glob.create(pattern, { const globber = await glob.create(pattern, {
followSymbolicLinks: false, followSymbolicLinks: false,
}); });
// fs.statSync resolve the symbolic link and returns stat for the // fs.stat resolve the symbolic link and returns stat for the
// file it pointed to, so isFile would make sure the resolved // file it pointed to, so isFile would make sure the resolved
// file is actually a regular file. // file is actually a regular file.
return (await globber.glob()).filter((file) => fs.statSync(file).isFile()); const files = [];
for (const file of await globber.glob()) {
const stats = await fs.stat(file);
if (stats.isFile()) {
files.push(file);
}
}
return files;
} }
function sort_and_uniq(a: string[]) { function sort_and_uniq(a: string[]) {

View File

@@ -42,7 +42,9 @@ async function run() {
lookupOnly, lookupOnly,
}); });
if (restoreKey) { if (restoreKey) {
const match = restoreKey === key; const match = restoreKey.localeCompare(key, undefined, {
sensitivity: "accent"
}) === 0;
core.info(`${lookupOnly ? "Found" : "Restored from"} cache key "${restoreKey}" full match: ${match}.`); core.info(`${lookupOnly ? "Found" : "Restored from"} cache key "${restoreKey}" full match: ${match}.`);
if (!match) { if (!match) {
// pre-clean the target directory on cache mismatch // pre-clean the target directory on cache mismatch

View File

@@ -39,9 +39,9 @@ async function run() {
const workspaceCrates = core.getInput("cache-workspace-crates").toLowerCase() || "false"; const workspaceCrates = core.getInput("cache-workspace-crates").toLowerCase() || "false";
const allPackages = []; const allPackages = [];
for (const workspace of config.workspaces) { for (const workspace of config.workspaces) {
const packages = await workspace.getPackagesOutsideWorkspaceRoot(); const packages = await workspace.getPackagesOutsideWorkspaceRoot(config.cmdFormat);
if (workspaceCrates === "true") { if (workspaceCrates === "true") {
const wsMembers = await workspace.getWorkspaceMembers(); const wsMembers = await workspace.getWorkspaceMembers(config.cmdFormat);
packages.push(...wsMembers); packages.push(...wsMembers);
} }
allPackages.push(...packages); allPackages.push(...packages);

View File

@@ -16,14 +16,15 @@ export function reportError(e: any) {
} }
export async function getCmdOutput( export async function getCmdOutput(
cmdFormat: string,
cmd: string, cmd: string,
args: Array<string> = [],
options: exec.ExecOptions = {}, options: exec.ExecOptions = {},
): Promise<string> { ): Promise<string> {
cmd = cmdFormat.replace("{0}", cmd);
let stdout = ""; let stdout = "";
let stderr = ""; let stderr = "";
try { try {
await exec.exec(cmd, args, { await exec.exec(cmd, [], {
silent: true, silent: true,
listeners: { listeners: {
stdout(data) { stdout(data) {
@@ -37,7 +38,7 @@ export async function getCmdOutput(
}); });
} catch (e) { } catch (e) {
(e as any).commandFailed = { (e as any).commandFailed = {
command: `${cmd} ${args.join(" ")}`, command: cmd,
stderr, stderr,
}; };
throw e; throw e;

View File

@@ -8,14 +8,15 @@ const SAVE_TARGETS = new Set(["lib", "proc-macro"]);
export class Workspace { export class Workspace {
constructor(public root: string, public target: string) {} constructor(public root: string, public target: string) {}
async getPackages(filter: (p: Meta["packages"][0]) => boolean, ...extraArgs: string[]): Promise<Packages> { async getPackages(cmdFormat: string, filter: (p: Meta["packages"][0]) => boolean, extraArgs?: string): Promise<Packages> {
const cmd = "cargo metadata --all-features --format-version 1" + (extraArgs ? ` ${extraArgs}` : "");
let packages: Packages = []; let packages: Packages = [];
try { try {
core.debug(`collecting metadata for "${this.root}"`); core.debug(`collecting metadata for "${this.root}"`);
const meta: Meta = JSON.parse( const meta: Meta = JSON.parse(
await getCmdOutput("cargo", ["metadata", "--all-features", "--format-version", "1", ...extraArgs], { await getCmdOutput(cmdFormat, cmd, {
cwd: this.root, cwd: this.root,
env: { "CARGO_ENCODED_RUSTFLAGS": "" }, env: { ...process.env, "CARGO_ENCODED_RUSTFLAGS": "" },
}), }),
); );
core.debug(`workspace "${this.root}" has ${meta.packages.length} packages`); core.debug(`workspace "${this.root}" has ${meta.packages.length} packages`);
@@ -29,12 +30,12 @@ export class Workspace {
return packages; return packages;
} }
public async getPackagesOutsideWorkspaceRoot(): Promise<Packages> { public async getPackagesOutsideWorkspaceRoot(cmdFormat: string): Promise<Packages> {
return await this.getPackages((pkg) => !pkg.manifest_path.startsWith(this.root)); return await this.getPackages(cmdFormat, (pkg) => !pkg.manifest_path.startsWith(this.root));
} }
public async getWorkspaceMembers(): Promise<Packages> { public async getWorkspaceMembers(cmdFormat: string): Promise<Packages> {
return await this.getPackages((_) => true, "--no-deps"); return await this.getPackages(cmdFormat, (_) => true, "--no-deps");
} }
} }

31
tests/flake.nix Normal file
View File

@@ -0,0 +1,31 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs @ { self, nixpkgs, flake-utils, rust-overlay, ... }:
flake-utils.lib.eachDefaultSystem (
system: let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs { inherit system overlays; };
in {
devShells.default = with pkgs; mkShell {
buildInputs = [
autoconf
gcc
gnumake
openssl
pkg-config
rust-bin.stable.latest.minimal
];
CARGO_TERM_COLOR = "always";
};
}
);
}