-
-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use GH Actions for parallelism rather than Yarn (#1029)
`yarn test` is a multi-package command: it really runs `yarn test` for each package in parallel using `yarn workspaces foreach`. This works fine as long as all of the tests pass. But because this command produces a lot of output, if tests fail for any package, it can be very difficult to locate the failure. (The same goes for `yarn validate:changelog`.) There are a few ways we could solve this when these commands are run locally, but it's particularly a pain point when run on CI. For this reason, this commit adjusts the GitHub Actions configuration so that we use GitHub Actions instead of Yarn to run these commands in parallel across the monorepo. This means that if tests fail for a particular package, you only see output for that package and no other package.
- Loading branch information
Showing
3 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!yarn ts-node | ||
|
||
import execa from 'execa'; | ||
|
||
main().catch((error) => { | ||
console.error(error); | ||
process.exitCode = 1; | ||
}); | ||
|
||
/** | ||
* The entrypoint to this script. | ||
*/ | ||
async function main() { | ||
const { stdout } = await execa('yarn', ['workspaces', 'list', '--json']); | ||
const workspaces = stdout.split('\n').map((line) => JSON.parse(line)); | ||
const childWorkspaceNames = workspaces | ||
.filter((workspace) => workspace.location !== '.') | ||
.map((workspace) => workspace.name); | ||
console.log(JSON.stringify(childWorkspaceNames)); | ||
} |