Skip to content

Commit

Permalink
use localstack to test aws upload
Browse files Browse the repository at this point in the history
Signed-off-by: Dweb Fan <[email protected]>
  • Loading branch information
dwebfan committed Jun 2, 2024
1 parent 5c12a16 commit 65e5069
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 22 deletions.
45 changes: 23 additions & 22 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,28 @@ on:
# - synchronize
# - reopened
jobs:
lint:
runs-on: ubuntu-22.04
container:
image: lomorage/lomo-backup:1.0
env:
PATH: /bin:/usr/bin:/usr/local/bin:/usr/local/go/bin
GOFLAGS: "-buildvcs=false"
steps:
- uses: actions/checkout@v4
- run: make lint

unit-test:
runs-on: ubuntu-22.04
container:
image: lomorage/lomo-backup:1.0
env:
PATH: /bin:/usr/bin:/usr/local/bin:/usr/local/go/bin
GOBIN: /usr/local/bin
GOFLAGS: "-buildvcs=false"
steps:
- uses: actions/checkout@v4
- run: make unit-tests
# lint:
# runs-on: ubuntu-22.04
# container:
# image: lomorage/lomo-backup:1.0
# env:
# PATH: /bin:/usr/bin:/usr/local/bin:/usr/local/go/bin
# GOFLAGS: "-buildvcs=false"
# steps:
# - uses: actions/checkout@v4
# - run: make lint
#
# unit-test:
# runs-on: ubuntu-22.04
# container:
# image: lomorage/lomo-backup:1.0
# env:
# PATH: /bin:/usr/bin:/usr/local/bin:/usr/local/go/bin
# GOBIN: /usr/local/bin
# GOFLAGS: "-buildvcs=false"
# steps:
# - uses: actions/checkout@v4
# - run: make unit-tests

e2e-test:
runs-on: ubuntu-22.04
Expand All @@ -44,6 +44,7 @@ jobs:
with:
submodules: true
fetch-depth: 0
- run: ./dockerfiles/run-localstack.sh
- run: cd test/data; find . | while read -r file; do git log -1 --format="%ad" --date=iso "$file" | xargs -t -I{} touch -d {} "$file"; done
- run: mkdir -p $WORKDIR; rsync -avz * $WORKDIR/; cd $WORKDIR; tree --si -D test/data/
- run: cd $WORKDIR; make install
Expand Down
13 changes: 13 additions & 0 deletions dockerfiles/run-localstack.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

docker run --rm -it -p 4566:4566 -p 4510-4559:4510-4559 localstack/localstack:3.4.0 &

while true; do
if curl localhost:4566; then
echo "Localstack is running!"
break
else
echo "Localstack is not yet ready. Retrying in 5 seconds..."
sleep 5
fi
done

0 comments on commit 65e5069

Please sign in to comment.