Skip to content

Commit

Permalink
Merge branch 'DMPRoadmap-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
briri committed Feb 19, 2020
2 parents 095a44d + 1fb3937 commit b0d6635
Show file tree
Hide file tree
Showing 66 changed files with 2,380 additions and 1,455 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/brakeman.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Brakeman

on:
pull_request:
branches:
master

jobs:
brakeman:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

# Will run Brakeman checks on dependencies
# https://github.com/marketplace/actions/brakeman-linter
- name: Brakeman
uses: devmasx/[email protected]
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
18 changes: 18 additions & 0 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: ESLint

on: [pull_request]

jobs:
eslint:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

# Will run ES Lint checks on javascript files
# https://github.com/marketplace/actions/run-eslint
- name: 'ES Lint checks'
uses: stefanoeb/[email protected]
with:
args: './app/javascript/**/*.js'
100 changes: 100 additions & 0 deletions .github/workflows/mysql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Run Tests (mySQL)

on: [pull_request]

jobs:
mysql:
runs-on: ubuntu-latest

env:
DB_ADAPTER: mysql2
MYSQL_PWD: root
RAILS_ENV: test
WICKED_PDF_PATH: vendor/bundle/bin/wkhtmltopdf

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

# Install the necessary MySQL dev 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]'`)

# Install Ruby - using the version found in the Gemfile.lock
- name: 'Install Ruby'
uses: actions/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}

# Copy all of the example configs over
- 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
# Try to retrieve the gems from the cache
- name: 'Cache Gems'
uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gem-
# Install bundler and run bundle install
- name: 'Bundle Install'
run: |
gem install bundler -v 1.17.2
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3 --without pgsql rollbar aws
# Try to retrieve the yarn JS dependencies from the cache
- name: 'Cache Yarn Packages'
uses: actions/cache@v1
with:
path: node_modules/
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-yarn-
${{ runner.os }}-
# 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

# Compile the assets
- name: 'Compile Assets'
run: |
bundle exec rake webpacker:compile RAILS_ENV=test
bundle exec rake assets:precompile RAILS_ENV=test
# Run the JS tests
- name: 'Run Karma Tests'
run: |
yarn add karma
yarn run test
# Run the Rspec tests
- name: 'Run Rspec Tests'
run: bundle exec rspec spec/
110 changes: 110 additions & 0 deletions .github/workflows/postgres.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: Run Tests (postgreSQL)

on: [pull_request]

jobs:
postgresql:
runs-on: ubuntu-latest

services:
# Postgres installation
db:
image: postgres:11
ports: ['5432:5432']
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
RAILS_ENV: test
DATABASE_URL: postgres://postgres:@localhost:5432/roadmap_test
WICKED_PDF_PATH: vendor/bundle/bin/wkhtmltopdf

steps:
# Checkout the repo
- uses: actions/checkout@v1
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]'`)

# Install Ruby - using the version found in the Gemfile.lock
- name: 'Install Ruby'
uses: actions/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}

# Copy all of the example configs over
- 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
# Try to retrieve the gems from the cache
- name: 'Cache Gems'
uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gem-
# Install bundler and run bundle install
- name: 'Bundle Install'
run: |
gem install bundler -v 1.17.2
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3 --without mysql rollbar aws
# Try to retrieve the yarn JS dependencies from the cache
- name: 'Cache Yarn Packages'
uses: actions/cache@v1
with:
path: node_modules/
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-yarn-
${{ runner.os }}-
# 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

# Compile the assets
- name: 'Compile Assets'
run: |
bundle exec rake webpacker:compile
bundle exec rake assets:precompile
# Run the JS tests
- name: 'Run Karma Tests'
run: |
yarn add karma
yarn run test
# Run the Rspec tests
- name: 'Run Rspec Tests'
run: bundle exec rspec spec/
34 changes: 34 additions & 0 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Commented out until we have time to do a full cleanup of the codebase

name: Rubocop

on: [pull_request]

jobs:
rubocop:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

# 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]'`)

# 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"
Loading

0 comments on commit b0d6635

Please sign in to comment.