1212
1313jobs :
1414 integration :
15- name : Run integration tests
15+ name : Run API tests
1616 runs-on : ubuntu-latest
1717 environment : staging
1818 permissions :
6868 env :
6969 INPUT_REF : ${{ inputs.ref }}
7070
71- - name : " integration (wfb): send a payload to workflow builder via webhook trigger"
71+ - name : " test (wfb): send a payload to workflow builder via webhook trigger"
7272 id : wfb
7373 uses : ./
7474 with :
@@ -82,12 +82,12 @@ jobs:
8282 repo_name: ${{ github.event.repository.full_name }}
8383 status: ${{ job.status }}
8484
85- - name : " integration (wfb): confirm a payload was sent"
85+ - name : " test (wfb): confirm a payload was sent"
8686 run : test -n "$WFB_OUTPUT_TIME"
8787 env :
8888 WFB_OUTPUT_TIME : ${{ steps.wfb.outputs.time }}
8989
90- - name : " integration(botToken ): post a message to channel"
90+ - name : " test(api ): post a message to channel"
9191 id : message
9292 uses : ./
9393 with :
@@ -98,12 +98,12 @@ jobs:
9898 channel: ${{ secrets.SLACK_CHANNEL_ID }}
9999 text: ":checkered_flag: Action happens at <https://github.com/${{ github.repository }}>"
100100
101- - name : " integration(method ): confirm a message was posted"
101+ - name : " test(api ): confirm a message was posted"
102102 run : test -n "$MESSAGE_OUTPUT_TS"
103103 env :
104104 MESSAGE_OUTPUT_TS : ${{ steps.message.outputs.ts }}
105105
106- - name : " integration(method ): post a message with blocks"
106+ - name : " test(api ): post a message with blocks"
107107 id : blocks
108108 uses : ./
109109 with :
@@ -120,12 +120,12 @@ jobs:
120120 short: true
121121 value: "Processing"
122122
123- - name : " integration(method ): confirm the blocks were posted"
123+ - name : " test(api ): confirm the blocks were posted"
124124 run : test -n "$BLOCKS_OUTPUT_TS"
125125 env :
126126 BLOCKS_OUTPUT_TS : ${{ steps.blocks.outputs.ts }}
127127
128- - name : " integration(method ): post a threaded message"
128+ - name : " test(api ): post a threaded message"
129129 id : timer
130130 uses : ./
131131 with :
@@ -137,15 +137,15 @@ jobs:
137137 text: "Started at `${{ steps.blocks.outputs.time }}`"
138138 thread_ts: "${{ steps.blocks.outputs.ts }}"
139139
140- - name : " integration(incoming ): confirm the thread started"
140+ - name : " test(api ): confirm the thread started"
141141 run : test -n "$TIMER_OUTPUT_TIME"
142142 env :
143143 TIMER_OUTPUT_TIME : ${{ steps.timer.outputs.time }}
144144
145- - name : " integration(method ): wait to mock event processing"
145+ - name : " test(api ): wait to mock event processing"
146146 run : sleep 3
147147
148- - name : " integration(method ): update the original message"
148+ - name : " test(api ): update the original message"
149149 id : finished
150150 uses : ./
151151 with :
@@ -163,7 +163,7 @@ jobs:
163163 short: true
164164 value: "Completed"
165165
166- - name : " integration(method ): post another threaded message"
166+ - name : " test(api ): post another threaded message"
167167 id : done
168168 uses : ./
169169 with :
@@ -175,7 +175,7 @@ jobs:
175175 text: "Finished at `${{ steps.finished.outputs.time }}`"
176176 thread_ts: "${{ steps.timer.outputs.thread_ts }}"
177177
178- - name : " integration(method ): post a file into a channel"
178+ - name : " test(api ): post a file into a channel"
179179 id : file
180180 uses : ./
181181 with :
@@ -188,7 +188,7 @@ jobs:
188188 file: .github/workflows/integration.yml
189189 filename: integration.yml
190190
191- - name : " integration(method ): react to the completed update message"
191+ - name : " test(api ): react to the completed update message"
192192 uses : ./
193193 with :
194194 errors : true
@@ -199,38 +199,38 @@ jobs:
199199 timestamp: ${{ steps.blocks.outputs.ts }}
200200 name: "tada"
201201
202- - name : " integration(method ): confirm the thread ended"
202+ - name : " test(api ): confirm the thread ended"
203203 run : test -n "$DONE_OUTPUT_TIME"
204204 env :
205205 DONE_OUTPUT_TIME : ${{ steps.done.outputs.time }}
206206
207- - name : " integration (incoming): post a message via incoming webhook"
207+ - name : " test (incoming): post a message via incoming webhook"
208208 id : incoming
209209 uses : ./
210210 with :
211211 errors : true
212212 webhook : ${{ secrets.SLACK_INCOMING_WEBHOOK }}
213213 webhook-type : incoming-webhook
214214 payload : |
215- text: "Incoming webhook test for slack send "
215+ text: "Incoming webhook test for the Slack GitHub Action "
216216 blocks:
217217 - type: section
218218 text:
219219 type: plain_text
220220 text: ":link: A message was received via incoming webhook"
221221 emoji: true
222222
223- - name : " integration (incoming): confirm a webhook was posted"
223+ - name : " test (incoming): confirm a webhook was posted"
224224 run : test -n "$INCOMING_WEBHOOK_OUTPUT_TIME"
225225 env :
226226 INCOMING_WEBHOOK_OUTPUT_TIME : ${{ steps.incoming.outputs.time }}
227227
228- - name : " integration (incoming): reveal contents of the github payload"
228+ - name : " test (incoming): reveal contents of the github payload"
229229 run : echo "$JSON"
230230 env :
231231 JSON : ${{ toJSON(github) }}
232232
233- - name : " integration (incoming): post a message via payload file"
233+ - name : " test (incoming): post a message via payload file"
234234 id : payload_file
235235 uses : ./
236236 with :
@@ -243,15 +243,80 @@ jobs:
243243 JOB_STATUS : ${{ job.status }}
244244 ATTACHMENT_COLOR : ${{ (job.status == 'success' && 'good') || (job.status == 'failure' && 'danger') || 'warning' }}
245245
246- - name : " integration (incoming): confirm a payload file was posted"
246+ - name : " test (incoming): confirm a payload file was posted"
247247 run : test -n "$PAYLOAD_FILE_OUTPUT_TIME"
248248 env :
249249 PAYLOAD_FILE_OUTPUT_TIME : ${{ steps.payload_file.outputs.time }}
250250
251- - name : " chore(health): check up on recent changes to the health score"
252- uses : slackapi/slack-health-score@d58a419f15cdaff97e9aa7f09f95772830ab66f7 # v0.1.1
251+ cli :
252+ name : Run CLI tests
253+ runs-on : ${{ matrix.os }}
254+ environment : staging
255+ strategy :
256+ fail-fast : false
257+ matrix :
258+ os :
259+ - ubuntu-latest
260+ - macos-latest
261+ - windows-latest
262+ permissions :
263+ contents : read
264+ steps :
265+ - name : " build: checkout the latest changes"
266+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
267+ with :
268+ persist-credentials : false
269+ ref : ${{ inputs.ref || github.event.pull_request.head.sha || github.sha }}
270+
271+ - name : " test(cli): run a slack cli version check"
272+ id : version
273+ uses : ./cli
274+ with :
275+ command : " version"
276+
277+ - name : " test(cli): confirm the version check outputs"
278+ shell : bash
279+ run : |
280+ set -ex
281+ [ "$CLI_OK" = "true" ]
282+ echo "$CLI_TIME" | grep -qE '^[0-9]+$'
283+ [ -n "$CLI_RESPONSE" ]
284+ env :
285+ CLI_OK : ${{ steps.version.outputs.ok }}
286+ CLI_RESPONSE : ${{ steps.version.outputs.response }}
287+ CLI_TIME : ${{ steps.version.outputs.time }}
288+
289+ - name : " test(cli): run an unknown command"
290+ id : unknown
291+ continue-on-error : true
292+ uses : ./cli
293+ with :
294+ command : " off"
295+
296+ - name : " test(cli): confirm the unknown command outputs"
297+ shell : bash
298+ run : |
299+ set -ex
300+ [ "$CLI_OK" = "false" ]
301+ echo "$CLI_TIME" | grep -qE '^[0-9]+$'
302+ [ -n "$CLI_RESPONSE" ]
303+ env :
304+ CLI_OK : ${{ steps.unknown.outputs.ok }}
305+ CLI_RESPONSE : ${{ steps.unknown.outputs.response }}
306+ CLI_TIME : ${{ steps.unknown.outputs.time }}
307+
308+ - name : " chore: configure the actioneering application"
309+ shell : bash
310+ run : mv .github/resources/.slack .slack
311+
312+ - name : " test(cli): validate the app manifest"
313+ uses : ./cli
314+ with :
315+ command : " manifest"
316+ token : ${{ secrets.SLACK_SERVICE_TOKEN }}
317+
318+ - name : " test(cli): deploy the app"
319+ uses : ./cli
253320 with :
254- codecov_token : ${{ secrets.CODECOV_API_TOKEN }}
255- github_token : ${{ secrets.GITHUB_TOKEN }}
256- extension : js
257- include : src
321+ command : " deploy --app ${{ vars.SLACK_APP_ID }} --hide-triggers --force"
322+ token : ${{ secrets.SLACK_SERVICE_TOKEN }}
0 commit comments