@@ -9,22 +9,33 @@ describe("Workflow", () => {
99 { name : "simple" , on : "push" , jobs : { } } ,
1010 ] ,
1111 [
12- new Workflow ( "simple" , { runName : "Simple Workflow" , on : "push" } ) ,
13- { name : "simple" , "run-name" : "Simple Workflow" , on : "push" , jobs : { } } ,
12+ new Workflow ( "with run-name" , { runName : "Simple Workflow" , on : "push" } ) ,
13+ {
14+ name : "with run-name" ,
15+ "run-name" : "Simple Workflow" ,
16+ on : "push" ,
17+ jobs : { } ,
18+ } ,
1419 ] ,
1520 [
16- new Workflow ( "simple" , { on : "push" , permissions : { contents : "read" } } ) ,
21+ new Workflow ( "with permissions" , {
22+ on : "push" ,
23+ permissions : { contents : "read" } ,
24+ } ) ,
1725 {
18- name : "simple " ,
26+ name : "with permissions " ,
1927 on : "push" ,
2028 permissions : { contents : "read" } ,
2129 jobs : { } ,
2230 } ,
2331 ] ,
2432 [
25- new Workflow ( "simple" , { on : "push" , env : { FOO : "foo" , BAR : "bar" } } ) ,
33+ new Workflow ( "with env" , {
34+ on : "push" ,
35+ env : { FOO : "foo" , BAR : "bar" } ,
36+ } ) ,
2637 {
27- name : "simple " ,
38+ name : "with env " ,
2839 on : "push" ,
2940 env : {
3041 FOO : "foo" ,
@@ -34,12 +45,12 @@ describe("Workflow", () => {
3445 } ,
3546 ] ,
3647 [
37- new Workflow ( "simple " , {
48+ new Workflow ( "with concurrency " , {
3849 on : "push" ,
3950 concurrency : { group : "group" , cancelInProgress : true } ,
4051 } ) ,
4152 {
42- name : "simple " ,
53+ name : "with concurrency " ,
4354 on : "push" ,
4455 concurrency : {
4556 group : "group" ,
@@ -48,21 +59,33 @@ describe("Workflow", () => {
4859 jobs : { } ,
4960 } ,
5061 ] ,
62+ [
63+ new Workflow ( "with defaults" , {
64+ on : "push" ,
65+ defaults : { run : { shell : "bash" } } ,
66+ } ) ,
67+ {
68+ name : "with defaults" ,
69+ on : "push" ,
70+ defaults : { run : { shell : "bash" } } ,
71+ jobs : { } ,
72+ } ,
73+ ] ,
5174 [
5275 ( ( ) => {
53- const workflow = new Workflow ( "simple " , { on : "push" } ) ;
76+ const workflow = new Workflow ( "with job " , { on : "push" } ) ;
5477 workflow . addJob (
55- new Job ( "test " , {
78+ new Job ( "simple-job " , {
5679 runsOn : "ubuntu-latest" ,
5780 } ) . run ( "echo 'Hello, world!'" ) ,
5881 ) ;
5982 return workflow ;
6083 } ) ( ) ,
6184 {
62- name : "simple " ,
85+ name : "with job " ,
6386 on : "push" ,
6487 jobs : {
65- test : {
88+ "simple-job" : {
6689 "runs-on" : "ubuntu-latest" ,
6790 steps : [ { run : "echo 'Hello, world!'" } ] ,
6891 } ,
0 commit comments