Skip to content

Commit

Permalink
Merge pull request #1 from koedame/feature/setup-ci
Browse files Browse the repository at this point in the history
Setup CI for coding style check
  • Loading branch information
unchidev authored Oct 8, 2022
2 parents 93d5688 + 3e66624 commit a3b7496
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 0 deletions.
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

0 comments on commit a3b7496

Please sign in to comment.