Skip to content

Commit

Permalink
Merge pull request #2709 from DMPRoadmap/development
Browse files Browse the repository at this point in the history
Finalize Rails5 release
  • Loading branch information
briri committed Nov 6, 2020
2 parents 3fdceea + d423df7 commit 1d80bb4
Show file tree
Hide file tree
Showing 996 changed files with 72,462 additions and 25,699 deletions.
16 changes: 0 additions & 16 deletions .babelrc

This file was deleted.

4 changes: 4 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
defaults
> .25%
Firefox >= 52
IE >= 10
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"spyOnEvent": true
},
"rules": {
"import/no-unresolved": "off",
"indent": [
"error",
2
Expand All @@ -39,4 +40,4 @@
"enforceForRenamedProperties": false
}]
}
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 5 additions & 3 deletions .github/workflows/brakeman.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ jobs:
- uses: actions/checkout@v2

# Will run Brakeman checks on dependencies
# https://github.com/marketplace/actions/brakeman-linter
# https://github.com/marketplace/actions/brakeman-action
- name: Brakeman
uses: devmasx/[email protected]
uses: artplan1/[email protected]
with:
flags: "--color"
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: ESLint

on: [pull_request]
on: [push, pull_request]

jobs:
eslint:
Expand Down
63 changes: 27 additions & 36 deletions .github/workflows/mysql.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run Tests (mySQL)
name: Tests - MySQL

on: [pull_request]

Expand All @@ -10,24 +10,24 @@ jobs:
DB_ADAPTER: mysql2
MYSQL_PWD: root
RAILS_ENV: test
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}

steps:
# Checkout the repo
- uses: actions/checkout@v2
with:
fetch-depth: 1

# Install the necessary MySQL dev packages
- name: 'Install Mysql Packages'
- name: 'Install MySQL Packages'
run: |
sudo apt-get update
sudo apt-get install -y mysql-client libmysqlclient-dev
# Extract the Ruby version from the Gemfile.lock
- name: 'Determine Ruby Version'
run: echo ::set-env name=RUBY_VERSION::$(echo `cat ./Gemfile.lock | grep -A 1 'RUBY VERSION' | grep 'ruby' | grep -oE '[0-9]\.[0-9]'`)
- name: 'Determine Ruby and Bundler Versions from Gemfile.lock'
run: |
echo ::set-env name=RUBY_VERSION::$(echo `cat ./Gemfile.lock | grep -A 1 'RUBY VERSION' | grep 'ruby' | grep -oE '[0-9]\.[0-9]'`)
echo ::set-env name=BUNDLER_VERSION::$(echo `cat ./Gemfile.lock | grep -A 1 'BUNDLED WITH' | grep -oE '[0-9]\.[0-9]'`)
# Install Ruby - using the version found in the Gemfile.lock
- name: 'Install Ruby'
uses: actions/setup-ruby@v1
with:
Expand All @@ -37,13 +37,10 @@ jobs:
- name: 'Setup Default Configuration'
run: |
# Make copies of all the example config files
cp config/branding.yml.sample config/branding.yml
cp config/database.yml.sample config/database.yml
cp config/secrets.yml.sample config/secrets.yml
cp config/initializers/contact_us.rb.example config/initializers/contact_us.rb
cp config/initializers/devise.rb.example config/initializers/devise.rb
cp config/initializers/recaptcha.rb.example config/initializers/recaptcha.rb
cp config/initializers/wicked_pdf.rb.example config/initializers/wicked_pdf.rb
cp config/credentials.yml.enc.workflow config/credentials.yml.enc
# Try to retrieve the gems from the cache
- name: 'Cache Gems'
Expand All @@ -54,10 +51,9 @@ jobs:
restore-keys: |
${{ runner.os }}-gem-
# Install bundler and run bundle install
- name: 'Bundle Install'
run: |
gem install bundler -v 1.17.2
gem install bundler -v ${{ env.BUNDLER_VERSION }}
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3 --without pgsql rollbar aws
Expand All @@ -73,41 +69,36 @@ jobs:
${{ runner.os }}-yarn-
${{ runner.os }}-
# Figure out where wkhtmltopdf is installed
- name: 'Determine wkhtmltopdf location'
run: echo ::set-env name=WICKED_PDF_PATH::$(echo `bundle exec which wkhtmltopdf`)

# Startup MySQL
- name: 'Start MySQL'
run: sudo systemctl start mysql


run: echo ::set-env name=WICKED_PDF_PATH::$(echo `bin/bundle exec which wkhtmltopdf`)

# Install the JS dependencies
- name: 'Yarn Install'
run: |
yarn install
# Figure out where wkhtmltopdf is installed
- name: 'Determine wkhtmltopdf location'
run: echo ::set-env name=WICKED_PDF_PATH::$(echo `bundle exec which wkhtmltopdf`)
- name: 'Start MySQL'
run: sudo systemctl start mysql

# Setup the database
- name: 'Setup Test DB'
run: bundle exec rake db:setup RAILS_ENV=test
run: bin/rails db:setup RAILS_ENV=test

- name: 'Migrate DB'
run: bin/rails db:migrate RAILS_ENV=test

# Compile the assets
- name: 'Compile Assets'
run: |
bundle exec rake webpacker:compile RAILS_ENV=test
bundle exec rake assets:precompile RAILS_ENV=test
bin/rails webpacker:compile
bin/rails assets:precompile
# Run the JS tests
- name: 'Run Karma Tests'
run: yarn test

- name: 'Run Rspec Unit and Functional Tests'
run: |
yarn add karma
yarn run test
bin/bundle exec rspec spec/models/ spec/policies/ spec/services/ spec/helpers/
bin/bundle exec rspec spec/controllers/ spec/presenters/ spec/requests/ spec/views
bin/bundle exec rspec spec/mixins/
# Run the Rspec tests
- name: 'Run Rspec Tests'
run: bundle exec rspec spec/
# Only run Integration tests if the PR or Push is to master or development branches
- name: 'Run Rspec Integration Tests'
run: bin/bundle exec rspec spec/features/
55 changes: 25 additions & 30 deletions .github/workflows/postgres.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run Tests (postgreSQL)
name: Tests - PostgreSQL

on: [pull_request]

Expand Down Expand Up @@ -26,23 +26,23 @@ jobs:
env:
RAILS_ENV: test
DATABASE_URL: postgres://postgres:@localhost:5432/roadmap_test
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}

steps:
# Checkout the repo
- uses: actions/checkout@v2
with:
fetch-depth: 1

# Install the necessary Postgres dev packages
- name: 'Install Postgresql Packages'
run: |
sudo apt-get update
sudo apt-get install libpq-dev
# Extract the Ruby version from the Gemfile.lock
- name: 'Determine Ruby Version'
run: echo ::set-env name=RUBY_VERSION::$(echo `cat ./Gemfile.lock | grep -A 1 'RUBY VERSION' | grep 'ruby' | grep -oE '[0-9]\.[0-9]'`)

- name: 'Determine Ruby and Bundler Versions from Gemfile.lock'
run: |
echo ::set-env name=RUBY_VERSION::$(echo `cat ./Gemfile.lock | grep -A 1 'RUBY VERSION' | grep 'ruby' | grep -oE '[0-9]\.[0-9]'`)
echo ::set-env name=BUNDLER_VERSION::$(echo `cat ./Gemfile.lock | grep -A 1 'BUNDLED WITH' | grep -oE '[0-9]\.[0-9]'`)
# Install Ruby - using the version found in the Gemfile.lock
- name: 'Install Ruby'
Expand All @@ -54,13 +54,10 @@ jobs:
- name: 'Setup Default Configuration'
run: |
# Make copies of all the example config files
cp config/branding.yml.sample config/branding.yml
cp config/database.yml.sample config/database.yml
cp config/secrets.yml.sample config/secrets.yml
cp config/initializers/contact_us.rb.example config/initializers/contact_us.rb
cp config/initializers/devise.rb.example config/initializers/devise.rb
cp config/initializers/recaptcha.rb.example config/initializers/recaptcha.rb
cp config/initializers/wicked_pdf.rb.example config/initializers/wicked_pdf.rb
cp config/credentials.yml.enc.workflow config/credentials.yml.enc
# Try to retrieve the gems from the cache
- name: 'Cache Gems'
Expand All @@ -71,10 +68,9 @@ jobs:
restore-keys: |
${{ runner.os }}-gem-
# Install bundler and run bundle install
- name: 'Bundle Install'
run: |
gem install bundler -v 1.17.2
gem install bundler -v ${{ env.BUNDLER_VERSION }}
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3 --without mysql rollbar aws
Expand All @@ -90,35 +86,34 @@ jobs:
${{ runner.os }}-yarn-
${{ runner.os }}-
# Figure out where wkhtmltopdf is installed
- name: 'Determine wkhtmltopdf location'
run: echo ::set-env name=WICKED_PDF_PATH::$(echo `bundle exec which wkhtmltopdf`)

# Install the JS dependencies
- name: 'Yarn Install'
run: |
yarn install
# Setup the database
- name: 'Setup Test DB'
run: bundle exec rake db:setup RAILS_ENV=test

# Migrate
run: bin/rails db:setup RAILS_ENV=test

- name: 'Migrate DB'
run: bundle exec rake db:migrate RAILS_ENV=test
run: bin/rails db:migrate RAILS_ENV=test

# Compile the assets
- name: 'Compile Assets'
run: |
bundle exec rake webpacker:compile
bundle exec rake assets:precompile
bin/rails webpacker:compile
bin/rails assets:precompile
# Run the JS tests
- name: 'Run Karma Tests'
run: |
yarn add karma
yarn run test
run: yarn test

# Run the Rspec tests
- name: 'Run Rspec Tests'
run: bundle exec rspec spec/
- name: 'Run Rspec Unit and Functional Tests'
run: |
bin/rspec spec/models/ spec/policies/ spec/services/ spec/helpers/
bin/rspec spec/controllers/ spec/presenters/ spec/requests/ spec/views
bin/rspec spec/mixins/
# Integration Tests are only run if PR or Push is to master or development branches
- name: 'Run Integration Tests'
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/development'
run: bin/rspec spec/features/
40 changes: 18 additions & 22 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,30 @@
# Commented out until we have time to do a full cleanup of the codebase

name: Rubocop

on: [pull_request]
on: [push, pull_request]

jobs:
rubocop:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

# Extract the Ruby version from the Gemfile.lock
# - name: 'Determine Ruby Version'
# run: echo ::set-env name=RUBY_VERSION::$(echo `cat ./Gemfile.lock | grep -A 1 'RUBY VERSION' | grep 'ruby' | grep -oE '[0-9]\.[0-9]'`)
- name: 'Determine Ruby and Bundler Versions from Gemfile.lock'
run: |
echo ::set-env name=RUBY_VERSION::$(echo `cat ./Gemfile.lock | grep -A 1 'RUBY VERSION' | grep 'ruby' | grep -oE '[0-9]\.[0-9]'`)
echo ::set-env name=BUNDLER_VERSION::$(echo `cat ./Gemfile.lock | grep -A 1 'BUNDLED WITH' | grep -oE '[0-9]\.[0-9]'`)
# Install Ruby - using the version found in the Gemfile.lock
# - name: 'Install Ruby'
# uses: actions/setup-ruby@v1
# with:
# ruby-version: ${{ env.RUBY_VERSION }}

# Will run Rubocop checks on the PR diffs and report any errors as commentary on the PR
# https://github.com/marketplace/actions/octocop
# - name: Octocop
# uses: Freshly/[email protected]
# with:
# github_token: ${{ secrets.github_token }}
# additional-gems: 'rubocop-dmp_roadmap'

- name: 'Placeholder for Rubocop'
run: echo "Rubocop has been temporarily disabled"
- name: 'Install Ruby'
uses: actions/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}

- name: 'Bundle Install'
run: |
gem install bundler -v ${{ env.BUNDLER_VERSION }}
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3 --without pgsql rollbar aws
- name: 'Run Rubocop'
run: bin/rubocop
13 changes: 11 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ config/secrets.yml
config/branding.yml

# Ignore some of the initializers
config/initializers/recaptcha.rb
config/initializers/devise.rb
config/initializers/wicked_pdf.rb
config/initializers/fingerprint.rb

Expand Down Expand Up @@ -103,3 +101,14 @@ spec/examples.txt
/node_modules
yarn-debug.log*
.yarn-integrity

# Ignore master key for decrypting credentials and more.
/config/master.key
/config/credentials.yml.enc

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

0 comments on commit 1d80bb4

Please sign in to comment.