Skip to content

Commit

Permalink
chore: restore webui metro cache in ci (#10)
Browse files Browse the repository at this point in the history
* chore: restore webui metro cache in ci

* chore: test webui metro cache
  • Loading branch information
byCedric authored Mar 17, 2024
1 parent c8f7cdc commit 1658f3a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/actions/setup-project/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 7 additions & 0 deletions webui/metro.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
const { getDefaultConfig } = require('expo/metro-config');
const { FileStore } = require('metro-cache');
const { withNativeWind } = require('nativewind/metro');
const path = require('path');

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;

0 comments on commit 1658f3a

Please sign in to comment.