Skip to content
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

CI ccache rework #2857

Merged
merged 8 commits into from
Jul 9, 2024
Merged

CI ccache rework #2857

merged 8 commits into from
Jul 9, 2024

Conversation

mikee47
Copy link
Contributor

@mikee47 mikee47 commented Jul 9, 2024

This PR makes a few changes to the way ccache is used for CI.

I did consider adding ccache detection to export.sh so it gets enabled by default.
Whilst ccache is great and seems quite robust, if things do go wrong it just adds more complication for users to sort out so requiring manual activation seems best I think.

Simplify CI ccache use

Hendrik Muhs ccache-action got things working easily, but it does installation and some other stuff which we don't need and creating versioned caches on every run is un-necessary.

Instead, just use the standard cache action as used for IDF tools, so pull requests use the develop branch cache if available or creates one. This keeps things clean and simple.

However, once created caches aren't update automatically, so I've added a workflows to rebuilding the tools which is required if the IDF toolchains get updated.

I've also added a second 'cache clean` workflow which removes any cache entries for pull requests (specifically, not develop).

Tidy action scripts

  • Actions if clause doesn't require ${{ }}
  • Add workflow_dispatch for both CI builds so we can trigger rebuilds manually if necessary.

Esp32 tools installation

Installer is still re-installing the tools (gdb, etc.) we've previously pruned out.
So just skip esp32 tools installation for CI if directory already present.

IDF also insists on pulling unwanted submodules back in again, even though they're not used.
Fortunately there is IDF_SKIP_CHECK_SUBMODULES=1 to disable this behaviour.

Also some improvements to the clean-tools.py script. Works much better. Have added some notes to the Tools/ci/README.rst.

This is also a useful step in identifying and eliminating stuff we don't need for Sming.
One thing I have in mind is getting rid of the IDF build step completely and just building the required code separately.

Unfortunately the whole SDK is excessively complex and have found the Rp2040 much easier to work with in practice.
If I ever find a serious application for the extra hardware in an esp32 I might revisit this...

mikee47 added 8 commits July 8, 2024 14:37
No need to run IDF installer at all which opens up more options for pruning crud
Setting is provided for CI use which is handy.
Even though the submodules aren't used, IDF still initialises them by default.
Default behaviour is closer to ideal
Cache doesn't need to be updated after **every** run.
Cache naming is cleaner
We're already dealing with installation so ccache action actually makes life more complicated.
- Simplify
- Use defined environment paths, very confusing otherwise
- Avoid trying to clean inside .git - fails anyway, but not the intent
- Found some more stuff to get rid of
- Further testing and fixes for Windows
Allows builds to be started from web page
@slaff slaff added this to the 5.2.0 milestone Jul 9, 2024
@slaff slaff merged commit 0706c25 into SmingHub:develop Jul 9, 2024
46 checks passed
@mikee47 mikee47 deleted the feature/ccache-rework branch July 9, 2024 20:41
@mikee47 mikee47 mentioned this pull request Jul 11, 2024
slaff pushed a commit that referenced this pull request Jul 11, 2024
Broken by #2857. Also enable ccache.

- `CI_BUILD_DIR` does not point to Sming build: must use SMING_HOME.
- Don't set CI_BUILD_DIR or SMING_HOME in `setenv.ps1` - it's wrong and already set in `.yml`
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.

2 participants