Skip to content

Commit 2d3f211

Browse files
no message
1 parent 4efc7c4 commit 2d3f211

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

.github/workflows/testcafe_tests.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,36 @@ jobs:
144144
}
145145
146146
const data = JSON.parse(fs.readFileSync(runJsonPath, 'utf8'));
147+
const getCache = () => {
148+
try {
149+
const { NxCache } = require('nx/src/native');
150+
const { workspaceRoot } = require('nx/src/utils/workspace-root');
151+
const { cacheDir } = require('nx/src/utils/cache-directory');
152+
const { getDbConnection } = require('nx/src/utils/db-connection');
153+
154+
return new NxCache(workspaceRoot, cacheDir, getDbConnection());
155+
} catch (error) {
156+
console.log(`Nx cache entry check unavailable: ${error.message}`);
157+
return null;
158+
}
159+
};
160+
const cache = getCache();
161+
const getCacheEntryStatus = (hash) => {
162+
if (!cache) {
163+
return 'unchecked';
164+
}
165+
166+
try {
167+
return cache.get(hash) ? 'present' : 'missing';
168+
} catch (error) {
169+
return `error: ${error.message}`;
170+
}
171+
};
147172
const tasks = (data.tasks ?? []).map((task) => ({
148173
taskId: task.taskId,
149174
hash: task.hash,
150175
cacheStatus: task.cacheStatus,
176+
cacheEntry: getCacheEntryStatus(task.hash),
151177
status: task.status,
152178
}));
153179

nx.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"libsDir": "packages"
4848
},
4949
"defaultBase": "master",
50+
"maxCacheSize": "5GB",
5051
"tui": {
5152
"enabled": false
5253
},

0 commit comments

Comments
 (0)