Skip to content

feat: allow task caching to github - #126

Open
KTrain5169 wants to merge 5 commits into
voidzero-dev:mainfrom
KTrain5169:github-task-cache
Open

feat: allow task caching to github#126
KTrain5169 wants to merge 5 commits into
voidzero-dev:mainfrom
KTrain5169:github-task-cache

Conversation

@KTrain5169

@KTrain5169 KTrain5169 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

edit: didn't realise my edits didn't go through properly, sorry

this PR adds the ability for the Vite task cache to be saved to GitHub Actions cache, and restored on every run.

closes voidzero-dev/vite-plus#2013

@fengmk2

fengmk2 commented Aug 16, 2026

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0967e734a5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/task-cache-restore.ts
return;
}

const primaryKey = `vite-task-${runnerOS}-${runnerArch}-${runId}-${runAttempt}`;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include a job-specific discriminator in the task-cache key

In workflows with multiple jobs on the same OS/architecture, every job shares this exact key because GITHUB_RUN_ID and GITHUB_RUN_ATTEMPT are workflow-wide. GitHub caches are immutable, so the first job to save reserves the key; later jobs either lose the save race or restore an exact hit and deliberately skip saving, meaning their task-cache entries are never persisted. Include a project/job or user-configurable discriminator so matrix and multi-project jobs can maintain independent caches.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure how I'm supposed to be doing this..,? this was the suggested key on the GitHub Actions Caching page as far as I remember

Comment thread action.yml
Comment on lines +40 to +43
task-cache:
description: "Enable task caching via GitHub Actions"
required: false
default: "false"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Document the new task-cache interface

The new input and output are absent from the public interface documentation: the Inputs table at README.md:329-344, Outputs table at README.md:350-355, and Caching section at README.md:357-375 still describe only dependency caching. Since the repository's marketplace README is how users discover and configure this action, the feature is effectively hidden and users cannot learn its cache path/key behavior or consume task-cache-hit; add the new input, output, and usage details there.

Useful? React with 👍 / 👎.

@fengmk2

fengmk2 commented Aug 16, 2026

Copy link
Copy Markdown
Member

@KTrain5169 Need to update the README to inform users how to use this feature.

@KTrain5169

Copy link
Copy Markdown
Contributor Author

thanks

@KTrain5169

Copy link
Copy Markdown
Contributor Author

@fengmk2 pushed

Comment thread README.md
run-install: true
```

### With Task Caching

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what I'm supposed to test here, is it just trying to save and restore using the setup-vp action vs the regualr cache action?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Vite Task GitHub Actions cache in setup-vp

2 participants