update addons #198
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: test | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
services: | |
mysql: | |
image: mysql:8.0 | |
env: | |
MYSQL_ALLOW_EMPTY_PASSWORD: 'true' | |
ports: | |
- 3306:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Create databases | |
run: mysql --host 127.0.0.1 --port 3306 -uroot -e "CREATE DATABASE users;CREATE DATABASE posts;CREATE DATABASE comments;" | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.21" | |
- name: Install golang-migrate | |
run: go install -tags 'mysql' github.com/golang-migrate/migrate/v4/cmd/migrate@latest | |
- name: Run migrations | |
run: make migrate-up | |
- name: Test | |
run: make test | |
- name: Cover | |
run: curl -s https://codecov.io/bash | bash | |