Skip to content

Commit 8d30e43

Browse files
Run coral tests after tflite is built
1 parent c4b5fb3 commit 8d30e43

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

presubmit.ts

+18-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,24 @@ parentDirs.forEach(curParentDir => {
3939
dirs.push(...curDirs.map(curDir => join(curParentDir, curDir)));
4040
})
4141

42-
dirs.forEach(dir => {
42+
// TODO(mattsoulanille): Packages are not sorted based on dependencies. There
43+
// are a few ways to fix this:
44+
// 1. Use only npm versions of packages, so they don't depend on each other.
45+
// 2. Parse package.json and implement topological sort here.
46+
// 3. Use something like Lerna or TurboRepo.
47+
// The current approach is just to enforce order in a subset of the packages.
48+
// It's not a scalabe approach.
49+
const dependenciesInOrder = new Set([
50+
'tfjs-tflite-node', 'coral-tflite-delegate']);
51+
const dirsSet = new Set(dirs);
52+
for (const dir of dirsSet) {
53+
if (dependenciesInOrder.has(dir)) {
54+
dirsSet.delete(dir);
55+
}
56+
}
57+
const sortedDirs = [...dirsSet, ...dependenciesInOrder];
58+
59+
sortedDirs.forEach(dir => {
4360
shell.cd(dir);
4461

4562
if (!fs.existsSync('./package.json')) {

0 commit comments

Comments
 (0)