-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (36 loc) · 1.6 KB
/
go.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
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Go
on:
push:
branches: [ "**" ]
pull_request:
branches: [ "**" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21.1'
- name: Docker Setup Docker
uses: crazy-max/ghaction-setup-docker@v2.0.0
- name: Run docker image
run: |
docker run --name dynamodb -d -p 8000:8000 -e "-jar DynamoDBLocal.jar -sharedDb -inMemory" amazon/dynamodb-local:2.2.0
docker run --name elasticsearch-v7 -d -p 19200:9200 -p 19300:9300 -e discovery.type=single-node -e ES_JAVA_OPTS="-Xms500m -Xmx500m" elasticsearch:7.17.16
docker network create elastic
docker run --name elasticsearch-v8 --net elastic -d -p 29200:9200 -p 29300:9300 -e discovery.type=single-node -e ES_JAVA_OPTS="-Xms500m -Xmx500m" -e xpack.security.enabled=false elasticsearch:8.11.3
docker run --name mongodb -d -p 27017:27017 mongo:7.0.4
docker run --name mysql -d -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root mysql:8.2.0
docker run --name redis -d -p 6379:6379 redis:7.2.3
docker run --name s3mock -d -p 9090:9090 -p 9191:9191 adobe/s3mock:3.3.0
- name: Sleep for 20 seconds
run: sleep 20s
shell: bash
- name: Test
run: go clean -testcache && go test -coverprofile=coverage.out -cover ./...
- name: Coverage
run: go tool cover -html=./coverage.out -o ./coverage.html