9292 token : ${{ secrets.PERSONAL_TOKEN }}
9393 wait-for-completion-interval : 10s
9494 wait-for-completion-timeout : 5m
95+ display-workflow-run-url-interval : 10s
96+ display-workflow-run-url-timeout : 5m
9597 continue-on-error : true
9698 - uses : nick-invision/assert-action@v1
9799 with :
@@ -105,7 +107,7 @@ jobs:
105107 failing-test :
106108 needs : [build]
107109 runs-on : ubuntu-latest
108- name : " failing-test [trigger+wait|by workflow filename|shoud report failure]"
110+ name : " failing-test [trigger+wait|by workflow filename|should report failure]"
109111 steps :
110112 - name : Check out repository
111113 uses : actions/checkout@v3
@@ -121,7 +123,9 @@ jobs:
121123 workflow : failing.yml
122124 token : ${{ secrets.PERSONAL_TOKEN }}
123125 wait-for-completion-interval : 10s
124- wait-for-completion-timeout : 5m
126+ wait-for-completion-timeout : 60s
127+ display-workflow-run-url-interval : 10s
128+ display-workflow-run-url-timeout : 60s
125129 continue-on-error : true
126130 - run : echo "worflow-conclusion=${{ steps.failing-workflow.outputs.workflow-conclusion }}"
127131 - uses : nick-invision/assert-action@v1
@@ -136,7 +140,7 @@ jobs:
136140 timeout-test :
137141 needs : [build]
138142 runs-on : ubuntu-latest
139- name : " timeout-test [trigger+wait|by workflow filename|shoud report timed_out]"
143+ name : " timeout-test [trigger+wait|by workflow filename|should report timed_out]"
140144 steps :
141145 - name : Check out repository
142146 uses : actions/checkout@v3
@@ -153,6 +157,8 @@ jobs:
153157 token : ${{ secrets.PERSONAL_TOKEN }}
154158 wait-for-completion-interval : 10s
155159 wait-for-completion-timeout : 30s
160+ display-workflow-run-url-interval : 10s
161+ display-workflow-run-url-timeout : 30s
156162 continue-on-error : true
157163 - uses : nick-invision/assert-action@v1
158164 with :
@@ -166,7 +172,7 @@ jobs:
166172 print-workflow-logs-test :
167173 needs : [build]
168174 runs-on : ubuntu-latest
169- name : " print-workflow-logs-test [trigger+wait|by workflow filename|print logs|shoud report timed_out]"
175+ name : " print-workflow-logs-test [trigger+wait|by workflow filename|print logs|should report timed_out]"
170176 steps :
171177 - name : Check out repository
172178 uses : actions/checkout@v3
@@ -183,6 +189,8 @@ jobs:
183189 token : ${{ secrets.PERSONAL_TOKEN }}
184190 wait-for-completion-interval : 10s
185191 wait-for-completion-timeout : 120s
192+ display-workflow-run-url-interval : 10s
193+ display-workflow-run-url-timeout : 120s
186194 workflow-logs : print
187195 continue-on-error : true
188196 - uses : nick-invision/assert-action@v1
@@ -198,10 +206,63 @@ jobs:
198206 # - name: Invoke external workflow using this action
199207 # uses: ./
200208 # with:
201- # workflow: Deploy To Kubernetes
209+ # workflow: Deploy To Kubernetes
202210 # repo: benc-uk/dapr-store
203211 # token: ${{ secrets.PERSONAL_TOKEN }}
204- # ref: master
212+ # ref: master
213+
214+ parallel-runs-test :
215+ needs : [build]
216+ runs-on : ubuntu-latest
217+ name : " parallel-runs-test [trigger+wait|by workflow filename|should succeed]"
218+ strategy :
219+ fail-fast : false
220+ matrix :
221+ environment :
222+ - trunk
223+ - staging
224+ env :
225+ RUN_NAME : ${{ github.repository }}/actions/runs/${{ github.run_id }}/envs/${{ matrix.environment }}
226+ steps :
227+ - name : Check out repository
228+ uses : actions/checkout@v3
229+ - name : Download dist
230+ uses : actions/download-artifact@v3
231+ with :
232+ name : build
233+ path : dist
234+ - name : Invoke 'named-run' workflow for this environment and wait for result using this action
235+ id : named-run-workflow
236+ uses : ./
237+ with :
238+ workflow : named-run.yml
239+ token : ${{ secrets.PERSONAL_TOKEN }}
240+ run-name : ${{ env.RUN_NAME }}
241+ wait-for-completion-interval : 10s
242+ wait-for-completion-timeout : 120s
243+ display-workflow-run-url-interval : 10s
244+ display-workflow-run-url-timeout : 120s
245+ workflow-logs : json-output
246+ inputs : >-
247+ {
248+ "run-name": "${{ env.RUN_NAME }}",
249+ "environment": "${{ matrix.environment }}"
250+ }
251+ continue-on-error : true
252+ - uses : nick-invision/assert-action@v1
253+ with :
254+ expected : success
255+ actual : ${{ steps.named-run-workflow.outputs.workflow-conclusion }}
256+ - uses : nick-invision/assert-action@v1
257+ with :
258+ expected : success
259+ actual : ${{ steps.named-run-workflow.outcome }}
260+ - uses : nick-invision/assert-action@v1
261+ env :
262+ EXPECTED_LOG_MESSAGE : " ### Env: ${{ matrix.environment }} ###"
263+ with :
264+ expected : true
265+ actual : ${{ contains(fromJson(steps.named-run-workflow.outputs.workflow-logs).echo.*.message, env.EXPECTED_LOG_MESSAGE) }}
205266
206267 deploy :
207268 needs :
@@ -211,6 +272,7 @@ jobs:
211272 - failing-test
212273 - timeout-test
213274 - print-workflow-logs-test
275+ - parallel-runs-test
214276 runs-on : ubuntu-latest
215277 steps :
216278 - name : Check out repository
0 commit comments