add:新規APIを追記 #183
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: CI | |
on: [push] | |
env: | |
ENVIRONMENT: dev | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.19 | |
- name: Build | |
run: go build -v | |
working-directory: ./go/app | |
##失敗したら通知 | |
- name: Slack Notification | |
if: failure() | |
uses: rtCamp/action-slack-notify@v2 | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
SLACK_USERNAME: stay-watch-backend | |
SLACK_ICON: https://s3-us-west-2.amazonaws.com/slack-files2/bot_icons/2023-01-01/4582569248242_48.png | |
SLACK_COLO JR: '#FF0000' | |
test: | |
runs-on: ubuntu-latest | |
services: | |
db: | |
image: mysql:8.0 | |
ports: | |
- 33066:3306 | |
env: | |
MYSQL_ROOT_PASSWORD: root | |
MYSQL_DATABASE: app | |
MYSQL_USER: user1 | |
MYSQL_PASSWORD: user | |
MYSQL_ROOT_HOST: '%' | |
options: >- | |
--health-cmd "mysqladmin ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Show Docker containers | |
run: docker ps -a | |
- name: Show databases for root user | |
run: mysql --protocol=tcp -h localhost -P 33066 -u root -proot -e "SHOW DATABASES" | |
- name: Show databases for user1 | |
run: mysql --protocol=tcp -h localhost -P 33066 -u user1 -puser -e "SHOW DATABASES" | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.19 | |
- name: Test | |
run: go test -v | |
working-directory: ./go/app/test | |
- name: Slack NotificationJ | |
uses: rtCamp/action-slack-notify@v2 | |
if: always() | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
SLACK_COLOR: ${{ job.status }} # (3) | |
SLACK_TITLE: Job Result | |
SLACK_ICON: https://s3-us-west-2.amazonaws.com/slack-files2/bot_icons/2023-01-01/4582569248242_48.png | |
SLACK_USERNAME: stay-watch-backend |