File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -103,7 +103,11 @@ def workflow_info(content):
103103 if len (keys ) == 1 :
104104 if matrix .get (keys [0 ]):
105105 for matrixed in matrix .get (keys [0 ]):
106- oss .append (matrixed )
106+ if isinstance (matrixed , list ):
107+ for r in matrixed :
108+ oss .append (r )
109+ else :
110+ oss .append (matrixed )
107111 elif len (keys ) > 1 :
108112 for system in dot_values (keys , matrix ):
109113 oss .append (system )
Original file line number Diff line number Diff line change @@ -369,3 +369,34 @@ def test_parses_none_matrix(self):
369369 0 ,
370370 f"Steps count in workflow: '{ info } ' does not match with expected"
371371 )
372+
373+ @pytest .mark .fast
374+ def test_parses_oss_as_list_in_matrix (self ):
375+ info = workflow_info (
376+ """
377+ name: test
378+ on: push
379+ jobs:
380+ build:
381+ strategy:
382+ matrix:
383+ os:
384+ - [self-hosted]
385+ runs-on: ${{ matrix.os }}
386+ """
387+ )
388+ self .assertEqual (
389+ info ["w_oss" ],
390+ ["self-hosted" ],
391+ f"Workflow OSs: '{ info } ' does not match with expected"
392+ )
393+ self .assertEqual (
394+ info ["w_jobs" ],
395+ 1 ,
396+ f"Jobs count in workflow: '{ info } ' does not match with expected"
397+ )
398+ self .assertEqual (
399+ info ["w_steps" ],
400+ 0 ,
401+ f"Steps count in workflow: '{ info } ' does not match with expected"
402+ )
You can’t perform that action at this time.
0 commit comments