update #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run test suites | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
services: | |
dynamo-local: | |
image: amazon/dynamodb-local:latest | |
ports: | |
- 8000:8000 | |
options: --name dynamo-local | |
mysql-local: | |
image: mysql:latest | |
ports: | |
- 3306:3306 | |
options: --name mysql-local -e MYSQL_ROOT_PASSWORD=123456 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.22 | |
- name: Install dependencies | |
run: go mod download | |
- name: Wait for DynamoDB Local to start | |
run: | | |
while ! nc -z localhost 8000; do sleep 1; done | |
- name: Wait for MySQL Local to start | |
run: | | |
while ! nc -z localhost 3306; do sleep 1; done | |
- name: Run tests | |
run: go test -v ./... |