initial commit for lite
parent
215a87d00f
commit
30fc23f900
@ -1,53 +0,0 @@
|
||||
source "https://rubygems.org"
|
||||
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
||||
|
||||
ruby "<%= RUBY_VERSION %>"
|
||||
|
||||
gem "active_type"
|
||||
<%= gemfile_entry "bcrypt", force: true -%>
|
||||
<%= gemfile_entry "bootsnap" -%>
|
||||
<%= gemfile_entry "cssbundling-rails" unless install_vite? -%>
|
||||
<%= gemfile_entry "importmap-rails" unless install_vite? -%>
|
||||
<%= gemfile_entry "jsbundling-rails" unless install_vite? -%>
|
||||
<%= gemfile_entry "pg" -%>
|
||||
gem "pgcli-rails"
|
||||
<%= gemfile_entry "puma" -%>
|
||||
gem "rack-canonical-host"
|
||||
gem "rails", "~> <%= Rails.version[/\d+\.\d+\.\d+/] %>"
|
||||
<%= gemfile_entry "sprockets-rails" -%>
|
||||
<%= gemfile_entry "stimulus-rails" -%>
|
||||
<%= gemfile_entry "turbo-rails" -%>
|
||||
<%= %Q{gem "vite_rails"\n} if install_vite? -%>
|
||||
|
||||
group :production do
|
||||
gem "postmark-rails"
|
||||
gem "sidekiq"
|
||||
end
|
||||
|
||||
group :development do
|
||||
gem "amazing_print"
|
||||
gem "annotate"
|
||||
gem "brakeman", require: false
|
||||
gem "bundler-audit", require: false
|
||||
gem "letter_opener"
|
||||
gem "rubocop", require: false
|
||||
gem "rubocop-minitest", require: false
|
||||
gem "rubocop-performance", require: false
|
||||
gem "rubocop-rails", require: false
|
||||
<%= gemfile_entry "web-console" -%>
|
||||
end
|
||||
|
||||
group :development, :test do
|
||||
gem "byebug"
|
||||
gem "dotenv-rails"
|
||||
gem "launchy"
|
||||
end
|
||||
|
||||
group :test do
|
||||
<%= gemfile_entry "capybara" -%>
|
||||
gem "minitest-ci", require: false
|
||||
<%= gemfile_entry "selenium-webdriver" -%>
|
||||
gem "shoulda-context"
|
||||
gem "shoulda-matchers"
|
||||
<%= gemfile_entry "webdrivers" -%>
|
||||
end
|
@ -1,6 +0,0 @@
|
||||
@import "@picocss/pico";
|
||||
|
||||
// Uncomment this to disable Pico's responsive sizing and instead respect the user's browser font size setting
|
||||
// :root {
|
||||
// --font-size: revert;
|
||||
// }
|
@ -1,2 +0,0 @@
|
||||
<% provide(:title, "Home") %>
|
||||
<p>Find me in app/views/home/index.html.erb</p>
|
@ -1,10 +0,0 @@
|
||||
<%# The "application" layout is the default layout. It extends "base" %>
|
||||
<%# to include things like header, footer, and alerts that are common %>
|
||||
<%# to most (but not all) views. %>
|
||||
|
||||
<main class="container">
|
||||
<%= render("shared/flash") %>
|
||||
<%= yield %>
|
||||
</main>
|
||||
|
||||
<% parent_layout "base" %>
|
@ -1,9 +0,0 @@
|
||||
<%# Notice %>
|
||||
<% if flash[:notice].present? %>
|
||||
<div class="alert alert-success"><%= flash[:notice] %></div>
|
||||
<% end %>
|
||||
|
||||
<%# Alert %>
|
||||
<% if flash[:alert].present? %>
|
||||
<div class="alert alert-danger"><%= flash[:alert] %></div>
|
||||
<% end %>
|
@ -1,100 +0,0 @@
|
||||
version: 2.1
|
||||
|
||||
orbs:
|
||||
browser-tools: circleci/browser-tools@1.2.5
|
||||
node: circleci/node@5.0.2
|
||||
ruby: circleci/ruby@1.6.0
|
||||
|
||||
executors:
|
||||
ruby:
|
||||
docker:
|
||||
- image: cimg/ruby:<%= RUBY_VERSION %>-browsers
|
||||
environment:
|
||||
PGHOST: 127.0.0.1
|
||||
PGUSER: postgres
|
||||
PGPASS: postgres
|
||||
RAILS_ENV: test
|
||||
- image: cimg/postgres:14.2
|
||||
environment:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
|
||||
commands:
|
||||
install_node_dependencies:
|
||||
steps:
|
||||
- node/install:
|
||||
install-yarn: true
|
||||
- node/install-packages:
|
||||
pkg-manager: yarn
|
||||
set_up_database:
|
||||
steps:
|
||||
- run:
|
||||
name: Set Up Database
|
||||
command: bundle exec rake db:create db:schema:load
|
||||
|
||||
jobs:
|
||||
static_analysis:
|
||||
executor: ruby
|
||||
steps:
|
||||
- checkout
|
||||
- ruby/install-deps
|
||||
- install_node_dependencies
|
||||
- run:
|
||||
name: Run Overcommit
|
||||
command: |
|
||||
gem install overcommit --no-document
|
||||
git config --local user.name "Circle CI"
|
||||
git config --local user.email ci@example.com
|
||||
overcommit --sign
|
||||
overcommit --run
|
||||
|
||||
security_audits:
|
||||
executor: ruby
|
||||
steps:
|
||||
- checkout
|
||||
- ruby/install-deps
|
||||
- run:
|
||||
name: Brakeman
|
||||
command: bundle exec brakeman --exit-on-warn --no-progress --color --output /dev/stdout
|
||||
- run:
|
||||
name: Bundle Audit
|
||||
command: bundle exec bundle-audit check --update -v
|
||||
|
||||
test:
|
||||
executor: ruby
|
||||
steps:
|
||||
- checkout
|
||||
- ruby/install-deps
|
||||
- set_up_database
|
||||
- run:
|
||||
name: Run Tests
|
||||
command: bundle exec rake test TESTOPTS="--ci-dir=./reports"
|
||||
- store_test_results:
|
||||
path: ./reports
|
||||
|
||||
test_system:
|
||||
executor: ruby
|
||||
steps:
|
||||
- browser-tools/install-chrome
|
||||
- browser-tools/install-chromedriver
|
||||
- checkout
|
||||
- ruby/install-deps
|
||||
- install_node_dependencies
|
||||
- set_up_database
|
||||
- run:
|
||||
name: Run System Tests
|
||||
command: bundle exec rake test:system TESTOPTS="--ci-dir=./reports"
|
||||
- store_test_results:
|
||||
path: ./reports
|
||||
- store_artifacts:
|
||||
path: ./tmp/screenshots
|
||||
destination: screenshots
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
commit-workflow:
|
||||
jobs:
|
||||
- static_analysis
|
||||
- security_audits
|
||||
- test
|
||||
- test_system
|
@ -1 +0,0 @@
|
||||
template "circleci/config.yml.tt", ".circleci/config.yml"
|
@ -0,0 +1,53 @@
|
||||
source "https://rubygems.org"
|
||||
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
||||
|
||||
ruby "<%= RUBY_VERSION %>"
|
||||
|
||||
<%= gemfile_entry "active_type" -%> # make any class quack like ActiveRecord
|
||||
<%= gemfile_entry "bcrypt", force: true -%>
|
||||
<%= gemfile_entry "bootsnap" -%>
|
||||
<%= gemfile_entry "cssbundling-rails" -%>
|
||||
<%= gemfile_entry "importmap-rails" -%>
|
||||
<%= gemfile_entry "jsbundling-rails" -%>
|
||||
<%= gemfile_entry "pg" -%>
|
||||
gem "pgcli-rails"
|
||||
<%= gemfile_entry "puma" -%>
|
||||
gem "rack-canonical-host"
|
||||
gem "rails", "~> <%= Rails.version[/\d+\.\d+\.\d+/] %>"
|
||||
<%= gemfile_entry "sprockets-rails" -%>
|
||||
<%= gemfile_entry "stimulus-rails" -%>
|
||||
<%= gemfile_entry "turbo-rails" -%>
|
||||
gem "bulma-rails" # good compromise CSS framework https://github.com/joshuajansen/bulma-rails https://bulma.io
|
||||
gem "haml-rails", "~> 2.0" # haml instead of erb for layouts, views and partials
|
||||
|
||||
group :production do
|
||||
gem "postmark-rails" # best email service https://postmarkapp.com/
|
||||
gem "sidekiq" # background jobs
|
||||
end
|
||||
|
||||
group :development do
|
||||
gem "amazing_print"
|
||||
gem "annotate" # model annotations https://github.com/ctran/annotate_models
|
||||
gem "brakeman", require: false
|
||||
gem "bundler-audit", require: false # security checks
|
||||
gem "flay", require: false # structural similarities analyzer https://github.com/seattlerb/flay
|
||||
gem "letter_opener" # don't send emails when working locally display them https://github.com/ryanb/letter_opener
|
||||
gem "rubocop", require: false
|
||||
gem "rubocop-rspec", require: false
|
||||
gem "rubocop-performance", require: false
|
||||
gem "rubocop-rails", require: false
|
||||
<%= gemfile_entry "web-console" -%> # web debug
|
||||
end
|
||||
|
||||
group :development, :test do
|
||||
gem "byebug" # console debug https://github.com/deivid-rodriguez/byebug#byebugs-commands
|
||||
gem "dotenv-rails"
|
||||
gem "launchy" # hepler for testing https://github.com/copiousfreetime/launchy
|
||||
end
|
||||
|
||||
group :test do
|
||||
<%= gemfile_entry "capybara" -%>
|
||||
<%= gemfile_entry "selenium-webdriver" -%>
|
||||
gem "rspec-rails"
|
||||
<%= gemfile_entry "webdrivers" -%>
|
||||
end
|
@ -0,0 +1 @@
|
||||
@import "bulma";
|
@ -0,0 +1,2 @@
|
||||
- provide(:title, "Home")
|
||||
%p Find me in app/views/home/index.haml
|
@ -0,0 +1,10 @@
|
||||
!!!
|
||||
%html
|
||||
%head
|
||||
%title
|
||||
|
||||
%body
|
||||
%section.section
|
||||
.container
|
||||
= render("shared/flash")
|
||||
= yield
|
@ -0,0 +1,6 @@
|
||||
-# Notice
|
||||
- if flash[:notice].present?
|
||||
.alert.alert-success= flash[:notice]
|
||||
-# Alert
|
||||
- if flash[:alert].present?
|
||||
.alert.alert-danger= flash[:alert]
|
@ -0,0 +1,18 @@
|
||||
version: "3.7"
|
||||
services:
|
||||
redis:
|
||||
image: redis:6.2
|
||||
ports:
|
||||
- "6379:6379"
|
||||
postgres:
|
||||
image: postgres:13.2
|
||||
ports:
|
||||
- "5432:5432"
|
||||
environment:
|
||||
- POSTGRES_PASSWORD=postgres
|
||||
- POSTGRES_USER=postgres
|
||||
volumes:
|
||||
- data-postgres:/var/lib/postgresql/data
|
||||
volumes:
|
||||
data-postgres:
|
||||
driver: local
|
@ -0,0 +1,90 @@
|
||||
# .semaphore/semaphore.yml
|
||||
version: v1.0
|
||||
name: Rails project
|
||||
agent:
|
||||
machine:
|
||||
type: e1-standard-2
|
||||
os_image: ubuntu2004
|
||||
blocks:
|
||||
- name: Setup
|
||||
dependencies: []
|
||||
task:
|
||||
jobs:
|
||||
- name: bundle
|
||||
commands:
|
||||
- sem-version ruby <%= RUBY_VERSION[/\d+\.\d+/] %>
|
||||
- sem-version node 16.15.0
|
||||
- checkout
|
||||
- cache restore
|
||||
- bundle install
|
||||
- cache store
|
||||
- name: Code scanning
|
||||
dependencies:
|
||||
- Setup
|
||||
task:
|
||||
jobs:
|
||||
- name: check style + security
|
||||
commands:
|
||||
- sem-version ruby 2.7.5
|
||||
- sem-version node 16.15.0
|
||||
- checkout
|
||||
- cache restore
|
||||
- bundle install
|
||||
- cache store
|
||||
- bundle exec rubocop
|
||||
- bundle exec brakeman
|
||||
- bundle exec flay
|
||||
- name: Unit tests
|
||||
dependencies:
|
||||
- Code scanning
|
||||
task:
|
||||
prologue:
|
||||
commands:
|
||||
- sem-version ruby 2.7.5
|
||||
- sem-version node 16.15.0
|
||||
- checkout
|
||||
- cache restore
|
||||
- bundle install
|
||||
- cache store
|
||||
- sem-service start postgres
|
||||
- 'bundle exec rake db:setup'
|
||||
jobs:
|
||||
- name: RSpec - model tests
|
||||
commands:
|
||||
- bundle exec rspec spec/models
|
||||
- name: RSpec - controller tests
|
||||
commands:
|
||||
- bundle exec rspec spec/controllers
|
||||
epilogue:
|
||||
always:
|
||||
commands:
|
||||
- "[[ -f junit.xml ]] && test-results publish --name \"🧪 Unit tests\" junit.xml"
|
||||
- name: Integration tests
|
||||
dependencies:
|
||||
- Unit tests
|
||||
task:
|
||||
prologue:
|
||||
commands:
|
||||
- sem-version ruby 2.7.5
|
||||
- sem-version node 16.15.0
|
||||
- checkout
|
||||
- cache restore
|
||||
- bundle install
|
||||
- cache store
|
||||
jobs:
|
||||
- name: RSpec - feature specs
|
||||
commands:
|
||||
- sem-service start postgres
|
||||
- 'bundle exec rake db:setup'
|
||||
- bundle exec rspec spec/features
|
||||
epilogue:
|
||||
always:
|
||||
commands:
|
||||
- "[[ -f junit.xml ]] && test-results publish --name \"🏗️ Integration tests\" junit.xml"
|
||||
|
||||
after_pipeline:
|
||||
task:
|
||||
jobs:
|
||||
- name: Publish Results
|
||||
commands:
|
||||
- test-results gen-pipeline-report
|
@ -0,0 +1 @@
|
||||
template "semaphore/semaphore.yml.tt", ".semaphore/semaphore.yml"
|
@ -0,0 +1,18 @@
|
||||
copy_file "test/spec/capybara_helper.rb"
|
||||
copy_file "test/spec/mailer_helper.rb"
|
||||
empty_directory_with_keep_file "spec/mailers"
|
||||
empty_directory_with_keep_file "spec/unit"
|
||||
empty_directory_with_keep_file "spec/requests"
|
||||
|
||||
# gsub_file "test/application_system_test_case.rb", /^ driven_by :selenium.*$/, <<~RUBY
|
||||
# driven_by :selenium,
|
||||
# using: (ENV["DISABLE_HEADLESS_CHROME"].present? ? :chrome : :headless_chrome),
|
||||
# screen_size: [1400, 1400] do |options|
|
||||
# options.add_argument("no-sandbox")
|
||||
# end
|
||||
|
||||
# def setup
|
||||
# Capybara.server = :puma, { Silent: true }
|
||||
# super
|
||||
# end
|
||||
# RUBY
|
@ -1,5 +1,3 @@
|
||||
# This has to come first
|
||||
require_relative "./support/rails"
|
||||
|
||||
# Load everything else from test/support
|
||||
Dir[File.expand_path("support/**/*.rb", __dir__)].sort.each { |rb| require(rb) }
|
@ -1,2 +0,0 @@
|
||||
# Generate XML test reports that can be parsed by CircleCI
|
||||
require "minitest/ci" if ENV["CIRCLECI"]
|
@ -1,11 +0,0 @@
|
||||
ENV["RAILS_ENV"] ||= "test"
|
||||
require_relative "../../config/environment"
|
||||
require "rails/test_help"
|
||||
|
||||
class ActiveSupport::TestCase
|
||||
# Run tests in parallel with specified workers
|
||||
parallelize(workers: :number_of_processors)
|
||||
|
||||
# Setup all fixtures in test/fixtures/*.yml for all tests in alpha order.
|
||||
fixtures :all
|
||||
end
|
@ -1,6 +0,0 @@
|
||||
Shoulda::Matchers.configure do |config|
|
||||
config.integrate do |with|
|
||||
with.test_framework :minitest
|
||||
with.library :rails
|
||||
end
|
||||
end
|
@ -1,24 +0,0 @@
|
||||
copy_file "test/test_helper.rb", force: true
|
||||
copy_file "test/support/capybara.rb"
|
||||
copy_file "test/support/circleci.rb"
|
||||
copy_file "test/support/mailer.rb"
|
||||
copy_file "test/support/rails.rb"
|
||||
copy_file "test/support/shoulda_matchers.rb"
|
||||
copy_file "test/system/layout_helper_test.rb"
|
||||
empty_directory_with_keep_file "test/mailers"
|
||||
empty_directory_with_keep_file "test/unit"
|
||||
empty_directory_with_keep_file "test/unit/lib"
|
||||
empty_directory_with_keep_file "test/unit/lib/tasks"
|
||||
|
||||
gsub_file "test/application_system_test_case.rb", /^ driven_by :selenium.*$/, <<~RUBY
|
||||
driven_by :selenium,
|
||||
using: (ENV["DISABLE_HEADLESS_CHROME"].present? ? :chrome : :headless_chrome),
|
||||
screen_size: [1400, 1400] do |options|
|
||||
options.add_argument("no-sandbox")
|
||||
end
|
||||
|
||||
def setup
|
||||
Capybara.server = :puma, { Silent: true }
|
||||
super
|
||||
end
|
||||
RUBY
|
Loading…
Reference in New Issue