Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/actions/cache-bundler/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Cache Bundler

description: Cache Ruby gems installed via Bundler.

inputs:
path:
description: Paths to cache
required: false
default: vendor/bundle
lock-file:
description: Path to Gemfile.lock
required: false
default: Gemfile.lock
cache-version:
description: Additional cache version segment
required: false
default: v1

outputs:
cache-hit:
description: Whether an exact match was found for the cache key
value: ${{ steps.cache.outputs.cache-hit }}

runs:
using: "composite"
steps:
- id: cache
name: Cache Ruby gems
uses: actions/cache@v4
with:
path: ${{ inputs.path }}
key: ${{ runner.os }}-gems-${{ inputs.cache-version }}-${{ hashFiles(inputs.lock-file) }}
restore-keys: |
${{ runner.os }}-gems-${{ inputs.cache-version }}-
${{ runner.os }}-gems-
33 changes: 33 additions & 0 deletions .github/actions/cache-gradle/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Cache Gradle

description: Cache Gradle wrappers and dependencies.

inputs:
path:
description: Paths to cache
required: false
default: |
~/.gradle/caches
~/.gradle/wrapper
cache-version:
description: Additional cache version segment
required: false
default: v1

outputs:
cache-hit:
description: Whether an exact match was found for the cache key
value: ${{ steps.cache.outputs.cache-hit }}

runs:
using: "composite"
steps:
- id: cache
name: Cache Gradle
uses: actions/cache@v4
with:
path: ${{ inputs.path }}
key: ${{ runner.os }}-gradle-${{ inputs.cache-version }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-${{ inputs.cache-version }}-
${{ runner.os }}-gradle-
37 changes: 37 additions & 0 deletions .github/actions/cache-pods/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Cache Pods

description: Cache CocoaPods dependencies.

inputs:
path:
description: Paths to cache
required: false
default: |
ios/Pods
~/Library/Caches/CocoaPods
lock-file:
description: Path to Podfile.lock
required: false
default: ios/Podfile.lock
cache-version:
description: Additional cache version segment
required: false
default: v1

outputs:
cache-hit:
description: Whether an exact match was found for the cache key
value: ${{ steps.cache.outputs.cache-hit }}

runs:
using: "composite"
steps:
- id: cache
name: Cache Pods
uses: actions/cache@v4
with:
path: ${{ inputs.path }}
key: ${{ runner.os }}-pods-${{ inputs.cache-version }}-${{ hashFiles(inputs.lock-file) }}
restore-keys: |
${{ runner.os }}-pods-${{ inputs.cache-version }}-
${{ runner.os }}-pods-
36 changes: 36 additions & 0 deletions .github/actions/cache-yarn/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Cache Yarn

description: Cache Yarn dependencies with consistent keys and paths.

inputs:
path:
description: Paths to cache
required: false
default: |
.yarn/cache
lock-file:
description: Path to yarn.lock
required: false
default: yarn.lock
cache-version:
description: Additional cache version segment
required: false
default: v1

outputs:
cache-hit:
description: Whether an exact match was found for the cache key
value: ${{ steps.cache.outputs.cache-hit }}

runs:
using: "composite"
steps:
- id: cache
name: Cache Yarn dependencies
uses: actions/cache@v4
with:
path: ${{ inputs.path }}
key: ${{ runner.os }}-yarn-${{ inputs.cache-version }}-${{ hashFiles(inputs.lock-file) }}
restore-keys: |
${{ runner.os }}-yarn-${{ inputs.cache-version }}-
${{ runner.os }}-yarn-
30 changes: 12 additions & 18 deletions .github/workflows/mobile-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:

- name: Cache Yarn dependencies
id: yarn-cache
uses: actions/cache@v4
uses: ./.github/actions/cache-yarn
with:
path: |
.yarn/cache
Expand All @@ -125,7 +125,7 @@ jobs:

- name: Cache Ruby gems
id: gems-cache
uses: actions/cache@v4
uses: ./.github/actions/cache-bundler
with:
path: ${{ env.APP_PATH }}/vendor/bundle
key: ${{ runner.os }}-ruby${{ env.RUBY_VERSION }}-gems-${{ env.GH_CACHE_VERSION }}-${{ env.GH_GEMS_CACHE_VERSION }}-${{ hashFiles('app/Gemfile.lock') }}
Expand All @@ -135,13 +135,13 @@ jobs:

- name: Cache CocoaPods
id: pods-cache
uses: actions/cache@v4
uses: ./.github/actions/cache-pods
with:
path: ${{ env.APP_PATH }}/ios/Pods
key: ${{ runner.os }}-pods-${{ env.GH_CACHE_VERSION }}-${{ env.GH_PODS_CACHE_VERSION }}-${{ hashFiles('app/ios/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-${{ env.GH_CACHE_VERSION }}-${{ env.GH_PODS_CACHE_VERSION }}-
${{ runner.os }}-pods-${{ env.GH_CACHE_VERSION }}-
path: |
${{ env.APP_PATH }}/ios/Pods
~/Library/Caches/CocoaPods
lock-file: app/ios/Podfile.lock
cache-version: ${{ env.GH_CACHE_VERSION }}-${{ env.GH_PODS_CACHE_VERSION }}

- name: Log cache status
run: |
Expand Down Expand Up @@ -541,7 +541,7 @@ jobs:

- name: Cache Yarn dependencies
id: yarn-cache
uses: actions/cache@v4
uses: ./.github/actions/cache-yarn
with:
path: |
.yarn/cache
Expand All @@ -554,7 +554,7 @@ jobs:

- name: Cache Ruby gems
id: gems-cache
uses: actions/cache@v4
uses: ./.github/actions/cache-bundler
with:
path: ${{ env.APP_PATH }}/vendor/bundle
key: ${{ runner.os }}-ruby${{ env.RUBY_VERSION }}-gems-${{ env.GH_CACHE_VERSION }}-${{ env.GH_GEMS_CACHE_VERSION }}-${{ hashFiles('app/Gemfile.lock') }}
Expand All @@ -564,15 +564,9 @@ jobs:

- name: Cache Gradle dependencies
id: gradle-cache
uses: actions/cache@v4
uses: ./.github/actions/cache-gradle
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ env.GH_CACHE_VERSION }}-${{ env.GH_GRADLE_CACHE_VERSION }}-${{ hashFiles('app/android/**/*.gradle*', 'app/android/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-${{ env.GH_CACHE_VERSION }}-${{ env.GH_GRADLE_CACHE_VERSION }}-
${{ runner.os }}-gradle-${{ env.GH_CACHE_VERSION }}-
cache-version: ${{ env.GH_CACHE_VERSION }}-${{ env.GH_GRADLE_CACHE_VERSION }}

- name: Cache Android NDK
id: ndk-cache
Expand Down
17 changes: 4 additions & 13 deletions .github/workflows/mobile-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,7 @@ jobs:
distribution: "temurin"
java-version: ${{ env.JAVA_VERSION }}
- name: Cache Gradle packages
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
uses: ./.github/actions/cache-gradle
- name: Setup Android SDK
uses: android-actions/setup-android@v3
with:
Expand Down Expand Up @@ -189,21 +182,19 @@ jobs:
restore-keys: |
${{ runner.os }}-node${{ env.NODE_VERSION }}-
- name: Cache Ruby gems
uses: actions/cache@v4
uses: ./.github/actions/cache-bundler
with:
path: app/vendor/bundle
key: ${{ runner.os }}-ruby${{ env.RUBY_VERSION }}-gems-${{ hashFiles('app/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-ruby${{ env.RUBY_VERSION }}-gems-
- name: Cache Pods
uses: actions/cache@v4
uses: ./.github/actions/cache-pods
with:
path: |
app/ios/Pods
~/Library/Caches/CocoaPods
key: ${{ runner.os }}-pods-${{ hashFiles('app/ios/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
lock-file: app/ios/Podfile.lock
- name: Cache Xcode build
uses: actions/cache@v4
with:
Expand Down
11 changes: 11 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,17 @@ yarn types
- For Noir circuits, run `nargo test -p <crate>` in each `noir/crates/*` directory.
- Tests for `@selfxyz/contracts` are currently disabled in CI and may be skipped.

### CI Caching

Use the shared composite actions in `.github/actions` when caching dependencies in GitHub workflows. They provide consistent cache paths and keys:

- `cache-yarn` for Yarn dependencies
- `cache-bundler` for Ruby gems
- `cache-gradle` for Gradle wrappers and caches
- `cache-pods` for CocoaPods

Each action accepts an optional `cache-version` input (often combined with `GH_CACHE_VERSION` and a tool-specific version). Avoid calling `actions/cache` directly so future workflows follow the same strategy.

### Formatting

- Use Prettier configuration from `.prettierrc` files.
Expand Down
Loading