-
Notifications
You must be signed in to change notification settings - Fork 8
153 lines (139 loc) · 5.05 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
name: LocalStack Test
on:
pull_request:
paths-ignore:
- ./*.md
- LICENSE
workflow_dispatch:
schedule:
- cron: '48 23 * * 0'
jobs:
localstack-action-test:
name: 'Test LocalStack GitHub Action'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# We must hack the action call as remote to be able to use the relative paths
# Could it break with different CWD? 🤔
- name: Start LocalStack
uses: jenseng/dynamic-uses@v1
with:
uses: LocalStack/setup-localstack@${{ env.GH_ACTION_VERSION }}
with: |-
{
"image-tag": "latest",
"install-awslocal": "true",
"configuration": "DEBUG=1",
"use-pro": "true",
}
env:
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
GH_ACTION_VERSION: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref_name }}
- name: Run Tests Against LocalStack
run: |
awslocal s3 mb s3://test
awslocal s3 ls
echo "Test Execution complete!"
localstack-action-version-test:
name: 'Test LocalStack Version with Github Actions'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# We must hack the action call as remote to be able to use the relative paths
# Could it break with different CWD? 🤔
- name: Start LocalStack
uses: jenseng/dynamic-uses@v1
with:
uses: LocalStack/setup-localstack@${{ env.GH_ACTION_VERSION }}
with: |-
{
"image-tag": "3.2.0",
"install-awslocal": "true",
"configuration": "DEBUG=1",
"use-pro": "true",
}
env:
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
GH_ACTION_VERSION: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref_name }}
- name: Run Version Test Against LocalStack
run: |
LS_VERSION=$(docker ps | grep localstack | cut -d " " -f4 | cut -d ":" -f2)
exit $(test "x${LS_VERSION}" = "x3.2.0")
cloud-pods-test:
name: 'Test Cloud Pods Action'
runs-on: ubuntu-latest
steps:
- name: ⚡️ Checkout the repository
uses: actions/checkout@v3
- name: Start LocalStack
uses: jenseng/dynamic-uses@v1
with:
uses: LocalStack/setup-localstack@${{ env.GH_ACTION_VERSION }}
with: |-
{
"image-tag": "latest",
"install-awslocal": "true",
"configuration": "DEBUG=1",
"use-pro": "true",
}
env:
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
GH_ACTION_VERSION: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref_name }}
- name: Run AWS commands
run: |
awslocal s3 mb s3://test
awslocal sqs create-queue --queue-name test-queue
- name: Save the Cloud Pod
uses: jenseng/dynamic-uses@v1
with:
uses: LocalStack/setup-localstack@${{ env.GH_ACTION_VERSION }}
with: |-
{
"state-name": "cloud-pods-test",
"state-action": "save",
}
env:
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
GH_ACTION_VERSION: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref_name }}
local-state-test:
name: 'Test Local State Action'
runs-on: ubuntu-latest
steps:
- name: ⚡️ Checkout the repository
uses: actions/checkout@v3
- name: Start LocalStack
uses: jenseng/dynamic-uses@v1
with:
uses: LocalStack/setup-localstack@${{ env.GH_ACTION_VERSION }}
with: |-
{
"image-tag": "latest",
"install-awslocal": "true",
"configuration": "DEBUG=1",
"use-pro": "true",
"state-name": "cloud-pods-test",
"state-action": "load",
"state-backend": "local",
}
env:
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
GH_ACTION_VERSION: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref_name }}
- name: Run AWS Commands
run: |
awslocal s3 mb s3://test
awslocal s3 rb s3://test
awslocal sqs create-queue --queue-name test-queue
awslocal sqs delete-queue --queue-url $(awslocal sqs get-queue-url --queue-name test-queue --output text)
- name: Save the State Artifact
uses: jenseng/dynamic-uses@v1
with:
uses: LocalStack/setup-localstack@${{ env.GH_ACTION_VERSION }}
with: |-
{
"state-name": "cloud-pods-test",
"state-action": "save",
"state-backend": "local",
}
env:
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
GH_ACTION_VERSION: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref_name }}