Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup CI for coding style check #1

Merged
merged 1 commit into from
Oct 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/coding-style-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Coding Style Check
on:
pull_request:
push:
branches:
- develop
- main

jobs:
coding-style-check:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Restore Cache
uses: actions/cache@v3
id: bundle_cache_id
env:
cache-name: cache-bundle
with:
path: ./vendor/bundle
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gem-${{ env.cache-name }}-
${{ runner.os }}-gem-
${{ runner.os }}-

- name: Install Packages
shell: bash
run: |
docker compose -f docker-compose.ci.yml run --rm app bundle install --jobs=16
docker compose -f docker-compose.ci.yml run --rm app bundle clean --force

- name: Run Linter
run: docker compose -f docker-compose.ci.yml run --rm app bundle exec standardrb
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ test/dummy/log/*.log
test/dummy/tmp/
test/reports
tmp
vendor/bundle
9 changes: 9 additions & 0 deletions Dockerfile.ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM ruby:alpine

ENV APP /app

WORKDIR $APP

RUN apk add --no-cache alpine-sdk git

RUN bundle config set path 'vendor/bundle'
9 changes: 9 additions & 0 deletions docker-compose.ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
services:
app:
container_name: app-rails-mermaid-erd
build:
context: .
dockerfile: Dockerfile.ci
volumes:
- .:/app
- ./vendor/bundle:/usr/local/bundle