Skip to content

Commit 2907f16

Browse files
committed
Adding simple Test
1 parent e31ad44 commit 2907f16

File tree

1 file changed

+83
-0
lines changed

1 file changed

+83
-0
lines changed

.github/workflows/test.yaml

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
---
2+
###############
3+
## Run tests ##
4+
###############
5+
6+
#
7+
# Documentation:
8+
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
9+
#
10+
11+
name: Test
12+
on:
13+
pull_request:
14+
push:
15+
branches: [ main ]
16+
17+
##########################
18+
# Prevent duplicate jobs #
19+
##########################
20+
concurrency:
21+
group: ${{ github.repository }}
22+
cancel-in-progress: false
23+
24+
permissions:
25+
id-token: write
26+
contents: read
27+
28+
###############
29+
# Run the job #
30+
###############
31+
jobs:
32+
self-test:
33+
name: GHA Test
34+
runs-on: ubuntu-latest
35+
steps:
36+
############################
37+
# Checkout the source code #
38+
############################
39+
- name: Checkout
40+
uses: actions/checkout@v4
41+
42+
#############################
43+
# Configure AWS credentials #
44+
#############################
45+
- name: Configure AWS credentials
46+
uses: aws-actions/configure-aws-credentials@v4
47+
with:
48+
role-to-assume: arn:aws:iam::${{ vars.AWS_TESTING_ACCOUNT_ID }}:role/${{ vars.AWS_TESTING_ROLE }}
49+
aws-region: ${{ vars.AWS_TESTING_REGION }}
50+
mask-aws-account-id: false
51+
52+
######################
53+
# Test Action itself #
54+
######################
55+
- name: Test Action
56+
uses: ./
57+
with:
58+
# Pre created
59+
cluster: github-gha
60+
task-definition: arn:aws:ecs:${{ vars.AWS_TESTING_REGION }}:${{ vars.AWS_TESTING_ACCOUNT_ID }}:task-definition/github-gha-alpine
61+
62+
assign-public-ip: 'ENABLED'
63+
security-group-ids: |
64+
sg-09a0ccb78d5be2a25
65+
subnet-ids: |
66+
subnet-08bbfd6c53b0c1049
67+
subnet-0fef13a6bef01f61a
68+
subnet-0a676289b4a27a7fa
69+
70+
tail-logs: true
71+
override-container: alpine
72+
override-container-command: |
73+
/bin/sh
74+
-c
75+
echo "Hello, World!" && \
76+
echo "$TEST_VAR" && \
77+
echo "Goodbye, World!"
78+
override-container-environment: |
79+
TEST_VAR=foobar123
80+
81+
task-wait-until-stopped: true
82+
task-start-max-wait-time: 120
83+
task-stopped-max-wait-time: 300

0 commit comments

Comments
 (0)