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

Update rails & ruby #158

Merged
merged 7 commits into from
Nov 16, 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
1 change: 1 addition & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
defaults
71 changes: 48 additions & 23 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,32 @@
# Ruby CircleCI 2.1 configuration file
# Ruby CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
#
version: 2.1
executors:
docker-publisher:
environment:
IMAGE_NAME: treatment-database-app
docker:
- image: docker:20.10.14-git

orbs:
ruby: circleci/ruby@1.8.0
node: circleci/node@5.0.2
browser-tools: circleci/browser-tools@1.3.0
coveralls: coveralls/coveralls@1.0.6

jobs:
build:
docker:
# specify the version you desire here
- image: circleci/ruby:2.6.5-node-browsers
- image: cimg/ruby:3.0.4-browsers

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/postgres:9.4

environment:
BUNDLE_PATH: vendor/bundle
BUNDLE_JOBS: 4
Expand All @@ -25,9 +39,12 @@ jobs:
CACHE_PATH: /tmp/cache
COVERALLS_PARALLEL: true


working_directory: ~/aaec

steps:
- browser-tools/install-chrome
- browser-tools/install-chromedriver
- checkout

- restore_cache:
Expand All @@ -41,13 +58,15 @@ jobs:
command: |
echo 'export BUNDLER_VERSION=$(cat Gemfile.lock | tail -1 | tr -d " ")' >> $BASH_ENV
source $BASH_ENV
gem install bundler -v 2.0.1
gem install bundler -v "$(grep -A 1 "BUNDLED WITH" Gemfile.lock | tail -n 1)"

- run:
name: Install Dependencies
command: |
bundle install --jobs=4 --retry=3 --path vendor/bundle
bundle install
sudo apt-get update
sudo apt-get install xvfb libfontconfig wkhtmltopdf
sudo apt-get install xvfb libfontconfig

- save_cache:
paths:
- ./vendor/bundle
Expand All @@ -62,28 +81,34 @@ jobs:
command: |
gem install rubocop
bundle exec rubocop

# Brakeman
crowesn marked this conversation as resolved.
Show resolved Hide resolved
# - run:
# name: Run Brakeman
# command: bundle exec brakeman -q -w 2

# Bundler-audit
# - run:
# name: Install Bundler-audit
# command: gem install bundler-audit
# - run:
# name: Run Bundle-audit
# command: bundle exec bundle audit check --update

# run tests!
- run:
name: Run rspec in parallel
command: |
mkdir /tmp/test-results
bundle exec rspec $(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
# collect reports
- store_test_results:
path: /tmp/test-results
- store_artifacts:
path: /tmp/test-results
destination: test-results
- store_artifacts:
path: coverage

- deploy:
name: Update Coveralls
command: |
curl -k https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN -d "payload[build_num]=$CIRCLE_BUILD_NUM&payload[status]=done"
#bundle exec rspec --out /tmp/test-results/rspec.xml $(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)

- coveralls/upload:
parallel_finished: true
path_to_lcov: /home/circleci/aaec/coverage/lcov/aaec.lcov

workflows:
version: 2
ci:
jobs:
- build:
name: ruby2-6-5
version: 2
ci:
jobs:
- build
4 changes: 2 additions & 2 deletions .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ AAEC_PUBLICATION_YEAR_START="January 2020"
AAEC_PUBLICATION_YEAR_END="December 2020"

# Expiration Date
EXPIRATION_DATE="Jan 1 2099"
PAST_DATE="Jan 2 2099"
EXPIRATION_DATE="Jan 01 2099"
PAST_DATE="Jan 02 2099"
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,14 @@
.env.development.local
.env.test.local
.env.production.local

/public/packs
/public/packs-test
/node_modules
/yarn-error.log
yarn-debug.log*
.yarn-integrity

# Ignore Vendor Local
/vendor/bundle --local
/vendor/bundle
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby-2.6.5
ruby-3.0.4
10 changes: 8 additions & 2 deletions Capfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,11 @@ task :use_rvm do
require 'capistrano/rvm'
end

task local: :use_rvm
task curly: :use_rvm
task :use_rbenv do
require 'capistrano/rbenv'
# require 'capistrano/rbenv_install'
end

task local: :use_rbenv
task qa: :use_rbenv
task production: :use_rbenv
13 changes: 9 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.6.5'
ruby '3.0.4'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.4'
gem 'rails', '~> 6.0.6'
# gem 'sqlite3'

# Use Puma as the app server
Expand All @@ -19,7 +19,7 @@ gem 'uglifier', '>= 1.3.0'
# gem 'mini_racer', platforms: :ruby

# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
gem 'coffee-rails', '~> 5.0'
gem 'coveralls', '~> 0.8.22', require: false
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
Expand All @@ -43,10 +43,13 @@ gem 'jbuilder', '~> 2.5'
gem 'bootsnap', '>= 1.1.0', require: false
gem 'bootstrap', '~> 4.4.1'

gem 'bcrypt_pbkdf'
gem 'dotenv-rails'
gem 'ed25519'
gem 'jquery-rails'
gem 'pagy', '~> 3.7'
gem 'truncato'
gem 'webpacker'

group :development, :test do
gem 'byebug', platforms: %i[mri mingw x64_mingw]
Expand All @@ -60,9 +63,11 @@ group :development, :test do
end

group :development do
gem 'capistrano', '~> 3.10', require: false
gem 'capistrano', '~> 3.17.1', require: false
gem 'capistrano-bundler', '~> 1.6', require: false
gem 'capistrano-rails', '~> 1.4', require: false
gem 'capistrano-rbenv', '~> 2.0' # required
gem 'capistrano-rbenv-install', '~> 1.2.0'
gem 'capistrano-rvm', require: false
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'listen', '>= 3.0.5', '< 3.2'
Expand Down
Loading