Skip to content

Commit 918c2c7

Browse files
committed
Revert "Revert "Use turbo for packing files in test setup (vercel#44074)""
This reverts commit fd8c119.
1 parent b1aed07 commit 918c2c7

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

.github/actions/next-stats-action/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"private": true,
33
"main": "src/index.js",
4+
"scripts": {
5+
"turbo": "turbo"
6+
},
47
"dependencies": {
58
"async-sema": "^3.1.0",
69
"fs-extra": "^8.1.0",
@@ -12,6 +15,7 @@
1215
"prettier": "^1.18.2",
1316
"pretty-bytes": "^5.3.0",
1417
"pretty-ms": "^5.0.0",
15-
"semver": "7.3.4"
18+
"semver": "7.3.4",
19+
"turbo": "1.6.3"
1620
}
1721
}

.github/actions/next-stats-action/src/prepare/repo-setup.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,18 @@ module.exports = (actionInfo) => {
167167
'test-pack': `yarn pack -f ${packedPkgPath}`,
168168
}
169169

170+
await fs.writeJSON(path.join(pkgPath, 'turbo.json'), {
171+
pipeline: {
172+
'test-pack': {
173+
outputs: [packedPkgPath],
174+
inputs: ['*', '!node_modules/', '!.turbo/'],
175+
},
176+
},
177+
})
178+
179+
// Turbo requires pnpm-lock.yaml that is not empty
180+
await fs.writeFile(path.join(pkgPath, 'pnpm-lock.yaml'), '')
181+
170182
await fs.writeFile(
171183
pkgDataPath,
172184
JSON.stringify(pkgData, null, 2),
@@ -186,7 +198,10 @@ module.exports = (actionInfo) => {
186198
.traceChild(`pack ${pkgName}`)
187199
.traceAsyncFn(async () => {
188200
const { pkgPath } = pkgDatas.get(pkgName)
189-
await exec(`pnpm run --dir="${pkgPath}" test-pack`, true)
201+
await exec(
202+
`pnpm run --dir="${turboRepoRoot}" turbo run test-pack --cache-dir="${turboCacheLocation}" --cwd="${pkgPath}"`,
203+
true
204+
)
190205
})
191206
})
192207
)

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"build": "turbo run build",
1313
"lerna": "lerna",
1414
"dev": "turbo run dev --parallel",
15+
"turbo": "turbo",
1516
"test-types": "pnpm tsc",
1617
"test-unit": "pnpm jest test/unit/",
1718
"test-dev": "cross-env NEXT_TEST_MODE=dev pnpm testheadless",

0 commit comments

Comments
 (0)