upgraded docker containers for golang and alpine, added simple integration test
This commit is contained in:
15
.github/workflows/docker-image.yml
vendored
15
.github/workflows/docker-image.yml
vendored
@@ -9,4 +9,17 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v3.3.0
|
||||
- name: Build the Docker image
|
||||
run: docker build . --file Dockerfile --tag yosoy-local:$(date +%s)
|
||||
run: docker build . --file Dockerfile --tag yosoy-local:latest
|
||||
- name: Run simple integration test
|
||||
run: |
|
||||
docker run -p 3333:80 yosoy-local:latest > yosoy.log &
|
||||
sleep 5
|
||||
RESULT=$(curl -s -X DELETE -H 'x-api-key: abc123' 'http://0.0.0.0:3333/sample/path?with=params')
|
||||
echo "$RESULT"
|
||||
if [[ $RESULT =~ '"method":"DELETE"' ]]
|
||||
echo 'Test successful'
|
||||
exit 0
|
||||
else
|
||||
echo 'Test failure'
|
||||
exit 1
|
||||
endif
|
||||
|
||||
2
.github/workflows/go.yml
vendored
2
.github/workflows/go.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: 1.16
|
||||
go-version: 1.19
|
||||
|
||||
- name: Build
|
||||
run: go build -v ./...
|
||||
|
||||
Reference in New Issue
Block a user