Skip to content

Commit

Permalink
Merge pull request #61 from motohiro-mm/feature/introduce_ci
Browse files Browse the repository at this point in the history
CIを設定
  • Loading branch information
motohiro-mm authored Sep 17, 2024
2 parents 46b5ac1 + cef0c6e commit 8b572e6
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: bundler
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 10
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 10
54 changes: 54 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: CI

on:
pull_request:
branches: [ main ]
push:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16.4-alpine
ports:
- "5432:5432"
env:
POSTGRES_DB: rails_test
POSTGRES_USER: rails
POSTGRES_PASSWORD: password
env:
RAILS_ENV: test
DATABASE_URL: "postgres://rails:password@localhost:5432/rails_test"
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
# migrationしたらコメントアウト外す
# - name: Set up database schema
# run: bin/rails db:schema:load
- name: Run tests
run: bundle exec rspec
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Install dependencies
run: npm install
- name: Security audit application code
run: bin/brakeman -q -w2
- name: Rubocop
run: bundle exec rubocop
- name: ERBLint
run: bundle exec erblint --lint-all
- name: ESLint and Prettier
run: npm run -s lint

0 comments on commit 8b572e6

Please sign in to comment.