forked from joscha/buildkite-graph
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alexandre Le Foll
authored
Nov 2, 2022
1 parent
d404a97
commit 019616b
Showing
5 changed files
with
613 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { Command, CommandStep, GroupStep, Pipeline } from '../src'; | ||
import { YamlSerializer } from '../src/serializers/yaml'; | ||
|
||
async function main() { | ||
const install = new Command('yarn', 2); | ||
|
||
const lint = new CommandStep([install, new Command('yarn lint', 1)]).withKey( | ||
'lint', | ||
); | ||
const test = new CommandStep([install, new Command('yarn test', 2)]) | ||
.withKey('test') | ||
.dependsOn(lint); | ||
const build = new CommandStep([install, new Command('yarn build', 5)]) | ||
.withKey('build') | ||
.dependsOn(lint); | ||
const integration = new CommandStep([ | ||
install, | ||
new Command('yarn integration', 10), | ||
]) | ||
.withKey('integration-test') | ||
.dependsOn(build); | ||
|
||
const group = new GroupStep('My group').add(test).add(integration); | ||
|
||
const pipeline = new Pipeline('My pipeline').add(group).add(integration); | ||
|
||
console.log(await new YamlSerializer().serialize(pipeline)); | ||
// console.log(await new YamlSerializer({ explicitDependencies: true }).serialize(pipeline)); | ||
// console.log(await new DotSerializer().serialize(pipeline)); | ||
} | ||
|
||
main(); |
Oops, something went wrong.