Skip to content

Commit

Permalink
Revert "Revert "Use turbo for packing files in test setup (vercel#44074
Browse files Browse the repository at this point in the history
…)""

This reverts commit fd8c119.
  • Loading branch information
jankaifer committed Jan 4, 2023
1 parent b1aed07 commit 918c2c7
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
6 changes: 5 additions & 1 deletion .github/actions/next-stats-action/package.json
@@ -1,6 +1,9 @@
{
"private": true,
"main": "src/index.js",
"scripts": {
"turbo": "turbo"
},
"dependencies": {
"async-sema": "^3.1.0",
"fs-extra": "^8.1.0",
Expand All @@ -12,6 +15,7 @@
"prettier": "^1.18.2",
"pretty-bytes": "^5.3.0",
"pretty-ms": "^5.0.0",
"semver": "7.3.4"
"semver": "7.3.4",
"turbo": "1.6.3"
}
}
17 changes: 16 additions & 1 deletion .github/actions/next-stats-action/src/prepare/repo-setup.js
Expand Up @@ -167,6 +167,18 @@ module.exports = (actionInfo) => {
'test-pack': `yarn pack -f ${packedPkgPath}`,
}

await fs.writeJSON(path.join(pkgPath, 'turbo.json'), {
pipeline: {
'test-pack': {
outputs: [packedPkgPath],
inputs: ['*', '!node_modules/', '!.turbo/'],
},
},
})

// Turbo requires pnpm-lock.yaml that is not empty
await fs.writeFile(path.join(pkgPath, 'pnpm-lock.yaml'), '')

await fs.writeFile(
pkgDataPath,
JSON.stringify(pkgData, null, 2),
Expand All @@ -186,7 +198,10 @@ module.exports = (actionInfo) => {
.traceChild(`pack ${pkgName}`)
.traceAsyncFn(async () => {
const { pkgPath } = pkgDatas.get(pkgName)
await exec(`pnpm run --dir="${pkgPath}" test-pack`, true)
await exec(
`pnpm run --dir="${turboRepoRoot}" turbo run test-pack --cache-dir="${turboCacheLocation}" --cwd="${pkgPath}"`,
true
)
})
})
)
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -12,6 +12,7 @@
"build": "turbo run build",
"lerna": "lerna",
"dev": "turbo run dev --parallel",
"turbo": "turbo",
"test-types": "pnpm tsc",
"test-unit": "pnpm jest test/unit/",
"test-dev": "cross-env NEXT_TEST_MODE=dev pnpm testheadless",
Expand Down

0 comments on commit 918c2c7

Please sign in to comment.