Feature/#33 add tags api #97
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: Backend CI | |
on: | |
pull_request: | |
paths: | |
- ".github/workflows/backend_test.yml" | |
- "backend/**" | |
jobs: | |
rspec_and_rubocop: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: copy backend.env.template | |
run: cp infra/env/backend.env.template infra/env/backend.env | |
- name: Build Docker image | |
run: | | |
docker compose build backend | |
- name: Create and Setup DB | |
# MySQLコンテナが応答できるまで10秒スリープする | |
# Ref: https://qiita.com/KazuyaInoue/items/758b3da37ecdf3039baf | |
run: | | |
docker compose up -d db | |
sleep 10 | |
docker compose run backend rails db:create | |
docker compose run backend rails db:create RAILS_ENV=test | |
docker compose run backend rake ridgepole:apply | |
- name: Run Rubocop | |
run: docker compose run backend bundle exec rubocop | |
- name: Run Rspec | |
run: docker compose run backend bundle exec rspec |