Skip to content

Commit 93f6f88

Browse files
authored
CI: stop swallowing emulator setup failures (#776)
1 parent 74f7a96 commit 93f6f88

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@ jobs:
188188
- name: Configure Fake GCS Server (GCP emulation)
189189
# Custom image - see fsouza/fake-gcs-server#1164
190190
run: |
191-
echo "GCS_CONTAINER=$(docker run -d -p 4443:4443 tustvold/fake-gcs-server -scheme http -backend memory -public-host localhost:4443)" >> $GITHUB_ENV
191+
GCS_CONTAINER=$(docker run -d -p 4443:4443 tustvold/fake-gcs-server -scheme http -backend memory -public-host localhost:4443)
192+
echo "GCS_CONTAINER=$GCS_CONTAINER" >> $GITHUB_ENV
192193
# Give the container a moment to start up prior to configuring it
193194
sleep 1
194195
curl -v -X POST --data-binary '{"name":"test-bucket"}' -H "Content-Type: application/json" "http://localhost:4443/storage/v1/b"
@@ -199,24 +200,28 @@ jobs:
199200

200201
- name: Setup LocalStack (AWS emulation)
201202
run: |
202-
echo "LOCALSTACK_CONTAINER=$(docker run -d -p 4566:4566 localstack/localstack:4.11.1)" >> $GITHUB_ENV
203-
echo "EC2_METADATA_CONTAINER=$(docker run -d -p 1338:1338 amazon/amazon-ec2-metadata-mock:v1.9.2 --imdsv2)" >> $GITHUB_ENV
203+
LOCALSTACK_CONTAINER=$(docker run -d -p 4566:4566 localstack/localstack:4.11.1)
204+
echo "LOCALSTACK_CONTAINER=$LOCALSTACK_CONTAINER" >> $GITHUB_ENV
205+
EC2_METADATA_CONTAINER=$(docker run -d -p 1338:1338 amazon/amazon-ec2-metadata-mock:v1.9.2 --imdsv2)
206+
echo "EC2_METADATA_CONTAINER=$EC2_METADATA_CONTAINER" >> $GITHUB_ENV
204207
aws --endpoint-url=http://localhost:4566 s3 mb s3://test-bucket
205208
aws --endpoint-url=http://localhost:4566 s3 mb s3://test-bucket-for-spawn
206209
aws --endpoint-url=http://localhost:4566 s3 mb s3://test-bucket-for-checksum
207210
aws --endpoint-url=http://localhost:4566 s3 mb s3://test-bucket-for-copy-if-not-exists
208211
aws --endpoint-url=http://localhost:4566 s3api create-bucket --bucket test-object-lock --object-lock-enabled-for-bucket
209212
210213
KMS_KEY=$(aws --endpoint-url=http://localhost:4566 kms create-key --description "test key")
211-
echo "AWS_SSE_KMS_KEY_ID=$(echo $KMS_KEY | jq -r .KeyMetadata.KeyId)" >> $GITHUB_ENV
214+
AWS_SSE_KMS_KEY_ID=$(jq -r .KeyMetadata.KeyId <<< "$KMS_KEY")
215+
echo "AWS_SSE_KMS_KEY_ID=$AWS_SSE_KMS_KEY_ID" >> $GITHUB_ENV
212216
213217
- name: Configure Azurite (Azure emulation)
214218
# the magical connection string is from
215219
# https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azurite?tabs=visual-studio#http-connection-strings
216220
# We skip the API version check to prevent breaks related to differences between Azurite, Azure and the azure-cli,
217221
# see https://github.com/Azure/Azurite/issues/2623
218222
run: |
219-
echo "AZURITE_CONTAINER=$(docker run -d -p 10000:10000 -p 10001:10001 -p 10002:10002 mcr.microsoft.com/azure-storage/azurite azurite -l /data --blobHost 0.0.0.0 --queueHost 0.0.0.0 --tableHost 0.0.0.0 --skipApiVersionCheck)" >> $GITHUB_ENV
223+
AZURITE_CONTAINER=$(docker run -d -p 10000:10000 -p 10001:10001 -p 10002:10002 mcr.microsoft.com/azure-storage/azurite azurite -l /data --blobHost 0.0.0.0 --queueHost 0.0.0.0 --tableHost 0.0.0.0 --skipApiVersionCheck)
224+
echo "AZURITE_CONTAINER=$AZURITE_CONTAINER" >> $GITHUB_ENV
220225
az storage container create -n test-bucket --connection-string 'DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://localhost:10000/devstoreaccount1;QueueEndpoint=http://localhost:10001/devstoreaccount1;'
221226
222227
- name: Setup Rust toolchain

0 commit comments

Comments
 (0)