Skip to content

Feature/1071 スクロール追加 #1

Feature/1071 スクロール追加

Feature/1071 スクロール追加 #1

Workflow file for this run

name: tbls-gen
on:
pull_request:
types:
- opened
- synchronize
- reopened
- closed
jobs:
gen:
name: tbls-gen
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
timeout-minutes: 10
services:
mysql:
image: mysql:8.0
ports:
- 3306:3306
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: db
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
steps:
- name: checkout
uses: actions/[email protected]
- name: Set up Go
uses: actions/[email protected]
with:
go-version-file: './server/go.mod'
cache: false
check-latest: true
id: go
- name: Ensure go.mod is tidied
working-directory: server
run: go mod tidy
- name: install golang-migrate
run: go install -tags 'mysql' github.com/golang-migrate/migrate/v4/cmd/migrate@latest
- name: mysql wakeup
run: |
until (echo 'SELECT 1' | mysql -h 127.0.0.1 -P 3306 -uroot --silent &> /dev/null); do echo "waiting for mysql to be connectable" && sleep 2; done
- name: mysql migrate for tbls
working-directory: server
run: |
mysql -h 127.0.0.1 -P 3306 -u root -e "CREATE DATABASE IF NOT EXISTS db DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin"
migrate -path db/migrations -database "mysql://root:@tcp(127.0.0.1:3306)/db?parseTime=true" up
- name: install tbls
uses: k1low/setup-tbls@v1
- name: run tbls
run: |
TBLS_DSN=mysql://root:@localhost:3306/db tbls doc --rm-dist --config server/config/.tbls.yml
- name: fix tbls
uses: dev-hato/actions-diff-pr-management@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
branch-name-prefix: fix-tbls