irgaly / xcode-cache

A GitHub Action to store Xcode's Build Cache for incremental build on CI
Other
37 stars 3 forks source link

add cache-read-only feature #63

Closed kondo0602 closed 1 month ago

kondo0602 commented 1 month ago

Feature Request: Conditional Caching for Xcode Builds in CI

Description of the Desired Feature

The current implementation always uses the action to cache Xcode builds. However, there are scenarios where we do not want to cache builds, such as when working on a development branch. We need a way to conditionally enable or disable caching based on certain conditions, such as branch name or specific environment variables.

Explanation of the Changes

To implement this feature, we propose to add a condition check within the cache action. This check would determine whether or not to proceed with the cache based on predefined conditions.

Impact

Allows flexible control over writing to the cache.

For example, the following configuration reduces CI time by preventing cache writes outside the main/staging/develop branch.

with: cache-read-only: ${{ github.ref ! = 'refs/heads/main' && github.ref ! = 'refs/heads/staging' && github.ref ! = 'refs/heads/develop' }}

Note that the default value is false (behavior unchanged from the original implementation), so projects using this action will not be affected by this feature addition.

Notes

irgaly commented 1 month ago

It sounds great šŸ‘ I'll see this PR, please wait a moment.

irgaly commented 1 month ago

It looks fine, and I'll merge this PR!

Thanks šŸ˜„

irgaly commented 1 month ago

v1.8.0 released, contains cache-read-only option.

https://github.com/irgaly/xcode-cache/releases/tag/v1.8.0