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

chore: restore webui metro cache in ci #10

Merged
merged 2 commits into from
Mar 17, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
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;