From 72f2efd8c8102301bd8e5bdf7ff347c1fefad3c9 Mon Sep 17 00:00:00 2001 From: Cedric van Putten Date: Sun, 17 Mar 2024 15:33:26 +0100 Subject: [PATCH 1/2] chore: restore webui metro cache in ci --- .github/actions/setup-project/action.yml | 10 ++++++++++ webui/metro.config.js | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/.github/actions/setup-project/action.yml b/.github/actions/setup-project/action.yml index 00e0673..ef3ec83 100644 --- a/.github/actions/setup-project/action.yml +++ b/.github/actions/setup-project/action.yml @@ -36,3 +36,13 @@ runs: run: bun install working-directory: webui shell: bash + + - name: ♻️ Restore webui cache + if: ${{ inputs.with-webui == 'true' }} + uses: actions/cache@v4 + with: + key: webui-metro-${{ runner.os }}-${{ github.sha }} + restore-keys: | + webui-metro-${{ runner.os }} + path: | + webui/node_modules/.cache/metro diff --git a/webui/metro.config.js b/webui/metro.config.js index 5ae8cb1..1c947c1 100644 --- a/webui/metro.config.js +++ b/webui/metro.config.js @@ -1,4 +1,5 @@ const { getDefaultConfig } = require('expo/metro-config'); +const { FileStore } = require('metro-cache'); const { withNativeWind } = require('nativewind/metro'); const path = require('path'); @@ -6,6 +7,11 @@ const config = withNativeWind(getDefaultConfig(__dirname), { input: './src/styles.css', }); +// Allow Metro to access the `~plugin/**` files config.watchFolders = [__dirname, path.resolve(__dirname, '..')]; +// Move the Metro cache to `node_modules/.cache` +config.cacheStores = [ + new FileStore({ root: path.join(__dirname, 'node_modules', '.cache', 'metro') }), +]; module.exports = config; From 798176a489f94887029b4e2361188e630bf444e3 Mon Sep 17 00:00:00 2001 From: Cedric van Putten Date: Sun, 17 Mar 2024 15:36:11 +0100 Subject: [PATCH 2/2] chore: test webui metro cache --- webui/metro.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/webui/metro.config.js b/webui/metro.config.js index 1c947c1..f400074 100644 --- a/webui/metro.config.js +++ b/webui/metro.config.js @@ -9,6 +9,7 @@ const config = withNativeWind(getDefaultConfig(__dirname), { // Allow Metro to access the `~plugin/**` files config.watchFolders = [__dirname, path.resolve(__dirname, '..')]; + // Move the Metro cache to `node_modules/.cache` config.cacheStores = [ new FileStore({ root: path.join(__dirname, 'node_modules', '.cache', 'metro') }),