This repository was archived by the owner on Mar 23, 2026. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
281 lines (252 loc) · 8.88 KB
/
aws-tests-s3-image.yml
File metadata and controls
281 lines (252 loc) · 8.88 KB
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
name: AWS / S3 Image Integration Tests
on:
push:
paths:
- .github/workflows/aws-tests-s3-image.yml
- localstack-core/localstack/aws/*.py
- localstack-core/localstack/aws/handlers/*¨
- localstack-core/localstack/aws/protocol/**
- localstack-core/localstack/aws/serving/**
- localstack-core/localstack/aws/api/s3/**
- localstack-core/localstack/http/**
- localstack-core/localstack/runtime/**
- localstack-core/localstack/services/s3/**
- localstack-core/localstack/*.py
- tests/aws/services/s3/**
- Dockerfile.s3
- requirements-*.txt
- setup.cfg
- Makefile
branches:
- main
pull_request:
paths:
- .github/workflows/aws-tests-s3-image.yml
- localstack-core/localstack/aws/*.py
- localstack-core/localstack/aws/handlers/*¨
- localstack-core/localstack/aws/protocol/**
- localstack-core/localstack/aws/serving/**
- localstack-core/localstack/aws/api/s3/**
- localstack-core/localstack/http/**
- localstack-core/localstack/runtime/**
- localstack-core/localstack/services/s3/**
- localstack-core/localstack/*.py
- tests/aws/services/s3/**
- Dockerfile.s3
- requirements-*.txt
- setup.cfg
- Makefile
workflow_dispatch:
inputs:
publishDockerImage:
description: 'Publish S3-only images on Dockerhub'
required: false
type: boolean
default: false
PYTEST_LOGLEVEL:
type: choice
description: Loglevel for PyTest
options:
- DEBUG
- INFO
- WARNING
- ERROR
- CRITICAL
default: WARNING
# Only one pull-request triggered run should be executed at a time
# (head_ref is only set for PR events, otherwise fallback to run_id which differs for every run).
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
# Configure PyTest log level
PYTEST_LOGLEVEL: "${{ inputs.PYTEST_LOGLEVEL || 'WARNING' }}"
# Set non-job-specific environment variables for pytest-tinybird
TINYBIRD_URL: https://api.tinybird.co
TINYBIRD_DATASOURCE: community_tests_s3_image
TINYBIRD_TOKEN: ${{ secrets.TINYBIRD_CI_TOKEN }}
CI_COMMIT_BRANCH: ${{ github.head_ref || github.ref_name }}
CI_COMMIT_SHA: ${{ github.sha }}
CI_JOB_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}
# report to tinybird if executed on main
TINYBIRD_PYTEST_ARGS: "${{ github.repository == 'localstack/localstack' && github.ref == 'refs/heads/main' && '--report-to-tinybird ' || '' }}"
jobs:
build-test-s3:
strategy:
matrix:
include:
- arch: amd64
runner: ubuntu-latest
- arch: arm64
runner: ubuntu-24.04-arm
name: "Build and Test S3 image"
env:
PLATFORM: ${{ matrix.arch }}
IMAGE_NAME: "localstack/localstack"
DEFAULT_TAG: "s3-latest"
# Set job-specific environment variables for pytest-tinybird
CI_JOB_NAME: ${{ github.job }}
CI_JOB_ID: ${{ github.job }}
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
# setuptools_scm requires the git history (at least until the last tag) to determine the version
fetch-depth: 0
- name: Login to Docker Hub
uses: docker/login-action@v3
# If this is triggered by a pull_request, make sure the PR head repo name is the same as the target repo name
# (i.e. do not execute job for workflows coming from forks)
if: >-
(
github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository
)
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version-file: '.python-version'
- name: Install docker build dependencies
run: pip install --upgrade setuptools setuptools_scm
- name: Build S3 Docker Image
env:
DOCKERFILE: "./Dockerfile.s3"
run: ./bin/docker-helper.sh build
- name: Run S3 Image tests
timeout-minutes: 10
env:
PYTEST_ARGS: "${{ env.TINYBIRD_PYTEST_ARGS }}-o junit_family=legacy --junitxml=target/pytest-junit-s3-image-${{ matrix.arch }}.xml"
TEST_PATH: "tests/aws/services/s3"
DEBUG: 1
run: |
mkdir target
make docker-run-tests-s3-only
- name: Archive Test Results
uses: actions/upload-artifact@v7
if: success() || failure()
with:
name: test-results-s3-image-${{ matrix.arch }}
path: target/pytest-junit-s3-image-${{ matrix.arch }}.xml
retention-days: 30
- name: Save the S3 image
id: save-image
run: ./bin/docker-helper.sh save
- name: Store Docker image as artifact
uses: actions/upload-artifact@v7
with:
name: localstack-s3-image-${{ matrix.arch }}
path: ${{ steps.save-image.outputs.IMAGE_FILENAME }}
retention-days: 1
publish-test-results:
name: "Publish S3 Image Test Results"
needs: build-test-s3
runs-on: ubuntu-latest
permissions:
checks: write
pull-requests: write
contents: read
issues: read
# If this is triggered by a pull_request, make sure the PR head repo name is the same as the target repo name
# (i.e. do not execute job for workflows coming from forks)
if: >-
(success() || failure()) && (
github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository
)
steps:
- name: Download AMD64 Results
uses: actions/download-artifact@v8
with:
name: test-results-s3-image-amd64
- name: Download ARM64 Results
uses: actions/download-artifact@v8
with:
name: test-results-s3-image-arm64
- name: Publish S3 Image Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: pytest-junit-*.xml
check_name: "S3 Image Test Results (AMD64 / ARM64)"
action_fail_on_inconclusive: true
push-s3-image:
name: "Push S3 images and manifest"
runs-on: ubuntu-latest
needs:
- build-test-s3
if: inputs.publishDockerImage
env:
IMAGE_NAME: "localstack/localstack"
DEFAULT_TAG: "s3-latest"
steps:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Checkout
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version-file: '.python-version'
- name: Install docker build dependencies
run: pip install --upgrade setuptools setuptools_scm
- name: Download AMD64 image
uses: actions/download-artifact@v8
with:
name: localstack-s3-image-amd64
- name: Download ARM64 image
uses: actions/download-artifact@v8
with:
name: localstack-s3-image-arm64
- name: Load AMD64 image
env:
PLATFORM: amd64
run: ./bin/docker-helper.sh load
- name: Push AMD64 image
env:
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
PLATFORM: amd64
run: ./bin/docker-helper.sh push
- name: Load ARM64 image
env:
PLATFORM: arm64
run: ./bin/docker-helper.sh load
- name: Push ARM64 image
env:
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
PLATFORM: arm64
run: ./bin/docker-helper.sh push
- name: Create and push manifest
env:
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
run: ./bin/docker-helper.sh push-manifests
cleanup:
name: "Clean up"
runs-on: ubuntu-latest
if: success()
needs: push-s3-image
steps:
- uses: geekyeggo/delete-artifact@v5
with:
name: localstack-s3-image-*
failOnError: false
push-to-tinybird:
if: always() && github.ref == 'refs/heads/main' && github.repository == 'localstack/localstack'
runs-on: ubuntu-latest
needs: push-s3-image
steps:
- name: Push to Tinybird
uses: localstack/tinybird-workflow-push@v3
with:
workflow_id: "tests_s3_image"
tinybird_token: ${{ secrets.TINYBIRD_CI_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
tinybird_datasource: "ci_workflows"