Skip to content

Commit

Permalink
Merge pull request #13 from mattlindsey/add_ci
Browse files Browse the repository at this point in the history
Add CI configuration
  • Loading branch information
mattlindsey authored Nov 26, 2023
2 parents 5165301 + b82fb72 commit ca4a90f
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# This workflow uses actions that are not certified by GitHub. They are
# provided by a third-party and are governed by separate terms of service,
# privacy policy, and support documentation.
#
# This workflow will install a prebuilt Ruby version, install dependencies, and
# run tests and linters.
name: "Mythographer CI"
on:
push:
branches: [ "*" ]
pull_request:
branches: [ "main" ]
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:12.1-alpine
ports:
- "5432:5432"
# env:
# POSTGRES_DB: mythographer_test
# POSTGRES_USER: rails
# POSTGRES_PASSWORD: password
env:
RAILS_ENV: test
DATABASE_URL: "postgres://postgres@localhost:5432/mythographer_test"
steps:
- name: Checkout code
uses: actions/checkout@v3
# Add or replace dependency steps here
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
# Add or replace database setup steps here
- name: Set up database schema
run: bin/rails db:setup
# Add or replace test runners here
- name: Run tests
run: bin/rails test:all

lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
# Add or replace any other lints here
- name: Security audit dependencies
run: bundle exec bundler-audit --update
- name: Security audit application code
run: bundle exec brakeman -q -w2
- name: Lint Ruby files
run: bundle exec rubocop --parallel --format progress --format github --color
17 changes: 17 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
require:
- rubocop-rails
- rubocop-capybara

AllCops:
NewCops: enable
Exclude:
- node_modules/**/*
- public/**/*
- vendor/**/*

Rails:
Enabled: true # enable rubocop-rails cops
Rails/I18nLocaleTexts:
Enabled: false # disable this cop because not using locales for now
Bundler/DuplicatedGem:
Enabled: false # ignore duplicated gem errors because we will have duplicated gems when dual booting
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ gem "bootsnap", require: false
group :development, :test do
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
gem "debug", platforms: %i[ mri windows ]
gem "rubocop-rails", require: false
gem "rubocop-capybara", require: false
gem "bundler-audit", require: false
gem "brakeman", require: false
end

group :development do
Expand Down
38 changes: 38 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,18 @@ GEM
tzinfo (~> 2.0)
addressable (2.8.5)
public_suffix (>= 2.0.2, < 6.0)
ast (2.4.2)
baran (0.1.10)
base64 (0.2.0)
bigdecimal (3.1.4)
bindex (0.8.1)
bootsnap (1.17.0)
msgpack (~> 1.2)
brakeman (6.0.1)
builder (3.2.4)
bundler-audit (0.9.1)
bundler (>= 1.2.0, < 3)
thor (~> 1.0)
capybara (3.39.2)
addressable
matrix
Expand Down Expand Up @@ -127,6 +132,7 @@ GEM
jbuilder (2.11.5)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
json (2.6.3)
json-schema (4.0.0)
addressable (>= 2.8)
langchainrb (0.7.5)
Expand All @@ -138,6 +144,7 @@ GEM
tiktoken_ruby (~> 0.0.5)
to_bool (~> 2.0.0)
zeitwerk (~> 2.5)
language_server-protocol (3.17.0.3)
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
Expand Down Expand Up @@ -169,6 +176,10 @@ GEM
racc (~> 1.4)
nokogiri (1.15.4-x86_64-linux)
racc (~> 1.4)
parallel (1.23.0)
parser (3.2.2.4)
ast (~> 2.4.1)
racc
pg (1.5.4)
pragmatic_segmenter (0.3.23)
unicode
Expand Down Expand Up @@ -216,6 +227,7 @@ GEM
rake (>= 12.2)
thor (~> 1.0, >= 1.2.2)
zeitwerk (~> 2.6)
rainbow (3.1.1)
rake (13.1.0)
rdoc (6.6.0)
psych (>= 4.0.0)
Expand All @@ -227,10 +239,31 @@ GEM
reline (0.4.0)
io-console (~> 0.5)
rexml (3.2.6)
rubocop (1.57.2)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.2.4)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.28.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
rubocop-capybara (2.19.0)
rubocop (~> 1.41)
rubocop-rails (2.22.2)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
ruby-openai (6.1.0)
event_stream_parser (>= 0.3.0, < 1.0.0)
faraday (>= 1)
faraday-multipart (>= 1)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
selenium-webdriver (4.15.0)
Expand Down Expand Up @@ -266,6 +299,7 @@ GEM
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode (0.4.4.4)
unicode-display_width (2.5.0)
web-console (4.2.1)
actionview (>= 6.0.0)
activemodel (>= 6.0.0)
Expand All @@ -287,6 +321,8 @@ PLATFORMS

DEPENDENCIES
bootsnap
brakeman
bundler-audit
capybara
debug
importmap-rails
Expand All @@ -297,6 +333,8 @@ DEPENDENCIES
rack-timeout
rails (~> 7.1.2)
redis (>= 4.0.1)
rubocop-capybara
rubocop-rails
ruby-openai (~> 6.1.0)
selenium-webdriver
sprockets-rails
Expand Down

0 comments on commit ca4a90f

Please sign in to comment.