Skip to content

Commit 608fb07

Browse files
committed
add debugging and try catch
1 parent 13eb53d commit 608fb07

File tree

1 file changed

+38
-3
lines changed

1 file changed

+38
-3
lines changed

.github/workflows/test.yaml

+38-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ permissions:
3030
###############
3131
jobs:
3232
self-test:
33-
name: GHA Test
33+
name: Testing
3434
runs-on: ubuntu-latest
3535
steps:
3636
############################
@@ -74,14 +74,16 @@ jobs:
7474
-c
7575
echo "Hello, World!" && \
7676
echo "$TEST_VAR" && \
77-
x=0; while [ $x -le 10 ]; do echo "Sleeping..." && x=$(( $x + 1 )) && sleep 2; done
77+
x=0; while [ $x -le 10 ]; do echo "Sleeping... $x" && x=$(( $x + 1 )) && sleep 2; done
7878
override-container-environment: |
7979
TEST_VAR=foobar123
8080
8181
######################
8282
# Test Action itself #
8383
######################
8484
- name: Test Failure Exit Code
85+
id: expect-fail
86+
continue-on-error: true
8587
uses: ./
8688
with:
8789
# Pre created
@@ -96,9 +98,42 @@ jobs:
9698
subnet-0fef13a6bef01f61a
9799
subnet-0a676289b4a27a7fa
98100
99-
tail-logs: false
100101
override-container: alpine
101102
override-container-command: |
102103
/bin/sh
103104
-c
104105
exit 1
106+
107+
##########################
108+
# Check expected failure #
109+
##########################
110+
- name: Check previous for Failure
111+
if: steps.expect-fail.outcome == 'success'
112+
run: |
113+
echo "Expected a failure. Outcome: ${{ steps.expect-fail.outcome }}"
114+
exit 1
115+
116+
######################
117+
# Test Action itself #
118+
######################
119+
- name: Test Fire and Forget
120+
uses: ./
121+
with:
122+
# Pre created
123+
cluster: github-gha
124+
task-definition: arn:aws:ecs:${{ vars.AWS_TESTING_REGION }}:${{ vars.AWS_TESTING_ACCOUNT_ID }}:task-definition/github-gha-alpine
125+
126+
assign-public-ip: 'ENABLED'
127+
security-group-ids: |
128+
sg-09a0ccb78d5be2a25
129+
subnet-ids: |
130+
subnet-08bbfd6c53b0c1049
131+
subnet-0fef13a6bef01f61a
132+
subnet-0a676289b4a27a7fa
133+
134+
task-wait-until-stopped: false
135+
override-container: alpine
136+
override-container-command: |
137+
/bin/sh
138+
-c
139+
x=0; while [ $x -le 10 ]; do echo "Sleeping... $x" && x=$(( $x + 1 )) && sleep 10; done

0 commit comments

Comments
 (0)