-
Notifications
You must be signed in to change notification settings - Fork 838
docs: add caching to cross-platform example workflow #954
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
🚀 Deployed on https://dev954--tauri.netlify.app |
|
This was discussed multiple times already, and i feel like it was always me who blocked it 😂 So imo this would be better suited for the testing example in the tauri-action repo or a new testing-in-CI guide (the latter probably doesn't offer much value idk) What do you think? |
|
Personally I prefer to help newer developers in a way that they can just delete the steps they don't want, instead of puzzle (during a learning curve) to get the best setup. In my opinion complete examples are useful. The official docs for a tool usually show close to "the best" approach, and is fine-tuned by the community if any mistakes are made. For that reason alone I think it's worth adding it. Besides that I think it's globally encouraged to iterate quickly and "release often". Many people might release a few times one week, and not at all for a few weeks after that. (often the case for my projects, 1 minor release and quickly after one or two patch releases when people notice bugs). I mean adding it would mean: Upsides:
Downsides:
That said. It's completely up to you. I'm just trying to be helpful towards newer devs who struggle with this kind of thing 😆 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sooo, i still don't agree (basing this on what i've seen in the community btw), but honestly i'm getting a bit tired of people asking for a cache (and then not using it in the end), so let's get it in anyway :D (interpret this as listening to the community :P )
I added 2 suggestions i'd like to hear your thoughts on.
Last thing that's not really related to this PR but i think we should add a comment or something to the yarn && yarn build step (or change the default), because the default template has yarn build configured as the beforeBuildCommand too so we're effectively building the frontend twice which depending on the frontend can add quite some time.
Co-authored-by: Fabian-Lars <[email protected]>
|
Haha, perhaps it'll be good, or perhaps you'll have people asking to remove it next. Thanks for your consideration. |
|
@FabianLars are you merging this? |
|
That's the plan yes. I did some more testing a few days (or weeks?) ago, trying to make it easier to configure and not yarn specific, but weren't able to finish it up yet (had to focus on other stuff etc). At this point i am not sure if we should even include a default (frontend) caching solution in the snippet but instead of a section explain possible solutions, reasons; First of all, we have to have the target audience in mind, most never worked with CI before, some of them not even with frontend stuff - this is btw the reason why i proposed the As i said above, i tried to make it easier or more general, for example by using npm, yarn and pnpm lockfiles for the cache key and potentially using setup-node for the global cache (so that we don't have to get&cache the path ourselves). Speaking of pnpm, not caching node_modules (but the global cache) is usually faster, or just as fast, because it installs the dependencies faster than the cache action can download, decompress and copy the Then we also have the issue of Please let me know if you have any ideas. If not i'd tend to go for the |
|
I see. Good effort! As for my input, I love creating a quick PR to open source projects and try and contribute a small iteration, but I do not have the capacity to stay deeply in context for each PR. Mostly I was just asking to see whether I should keep my fork around or not. I have no strong preference towards one either solution. Please do feel free to apply your suggestion. |
|
Okay let's make it quick and easy then, i'll use setup-node and re-iterate as soon as i can. Thank you for your contribution and sorry for the super long delay! |
|
You're welcome! And thank you so much for your effort as well as maintaining this package in general. |
* fix(deps): update dependency docs-searchbar.js to v2.4.1 (#996) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * More idiomatic NixOS setup (#995) * directly reference clap link for the features doc card list (#997) * fix(deps): update dependency react-markdown to v8.0.4 (#998) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * docs: add caching to cross-platform example workflow (#954) * Update cross-platform.md * remove shared-key Co-authored-by: Fabian-Lars <[email protected]> * Update docs/guides/building/cross-platform.md Co-authored-by: Fabian-Lars <[email protected]> * Add optimization tip for "compression" feature (#930) * Move to using combined locale and two-digit codes for i18n * Add Crowdin admin note for i18n * I blame @FabianLars if it breaks anything (#999) * fix: Update github action guide (#1000) * fix: Update github action guide * Update cross-platform.md * ci: Update actions in update-docs workflow (#1002) * Add args example to sidecar doc (#1003) Add a section in sidecar doc to demo how to pass args to sidecar cmds * update git submodule * fix(generator): adapt renamed property * ci: Always pull latest version of submodule * chore(docs): Update Rust & TS docs (#1004) Co-authored-by: FabianLars <[email protected]> * Updated Crowdin config to include more Guides pages (#1005) * Updated Crowdin config to include more Guides pages * Fixed the path to updater.md * Feat/i18n banner (#1006) * Add i18n banner * Fix styles * Fix i18n preview * Change i18n preview to use locale instead of twoLetterCode Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Ben Buscarino <[email protected]> Co-authored-by: Lucas Fernandes Nogueira <[email protected]> Co-authored-by: Webber Takken <[email protected]> Co-authored-by: Fabian-Lars <[email protected]> Co-authored-by: Will <[email protected]> Co-authored-by: Kenneth <[email protected]> Co-authored-by: tauri <[email protected]> Co-authored-by: FabianLars <[email protected]> Co-authored-by: DK Liao <[email protected]>
* fix(deps): update dependency docs-searchbar.js to v2.4.1 (#996) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * More idiomatic NixOS setup (#995) * directly reference clap link for the features doc card list (#997) * fix(deps): update dependency react-markdown to v8.0.4 (#998) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * docs: add caching to cross-platform example workflow (#954) * Update cross-platform.md * remove shared-key Co-authored-by: Fabian-Lars <[email protected]> * Update docs/guides/building/cross-platform.md Co-authored-by: Fabian-Lars <[email protected]> * Add optimization tip for "compression" feature (#930) * Move to using combined locale and two-digit codes for i18n * Add Crowdin admin note for i18n * I blame @FabianLars if it breaks anything (#999) * fix: Update github action guide (#1000) * fix: Update github action guide * Update cross-platform.md * ci: Update actions in update-docs workflow (#1002) * Add args example to sidecar doc (#1003) Add a section in sidecar doc to demo how to pass args to sidecar cmds * update git submodule * fix(generator): adapt renamed property * ci: Always pull latest version of submodule * chore(docs): Update Rust & TS docs (#1004) Co-authored-by: FabianLars <[email protected]> * Updated Crowdin config to include more Guides pages (#1005) * Updated Crowdin config to include more Guides pages * Fixed the path to updater.md * Feat/i18n banner (#1006) * Add i18n banner * Fix styles * Fix i18n preview * Change i18n preview to use locale instead of twoLetterCode * chore(deps): update dependency typescript to v4.9.4 (#1008) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(docs): Update Rust & TS docs (#1009) Co-authored-by: tauri-bot <[email protected]> * docs: fix typo (#1011) * feat(blog): add 2.0.0-alpha.0 (mobile) announcement (#1012) Co-authored-by: Lorenzo Lewis <[email protected]> * fix: add rust target command to macos build guide (#1015) * fix: add rust target command to macos build guide * typo * fix prereq sidebar layout and link to it from mobile docs Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Ben Buscarino <[email protected]> Co-authored-by: Lucas Fernandes Nogueira <[email protected]> Co-authored-by: Webber Takken <[email protected]> Co-authored-by: Will <[email protected]> Co-authored-by: Lorenzo Lewis <[email protected]> Co-authored-by: Kenneth <[email protected]> Co-authored-by: tauri <[email protected]> Co-authored-by: FabianLars <[email protected]> Co-authored-by: DK Liao <[email protected]> Co-authored-by: tauri-bot <[email protected]> Co-authored-by: Ayanava Karmakar <[email protected]>
Add caching to the default workflow.
This is a pretty standard step I'd say that many people (and machines) would benefit from.
Before:

After (from second run after implementing it)

See it in action: webbertakken/map-editor-2d#17
Changes are reflected here: https://deploy-preview-954--tauri.netlify.app/v1/guides/building/cross-platform#example-workflow