Skip to content

Commit

Permalink
Merge pull request #213 from OPIDoR/dmpopidor-dev
Browse files Browse the repository at this point in the history
Merge dev into master
  • Loading branch information
benjaminfaure authored Apr 29, 2022
2 parents 2f7792a + ce75777 commit eef511d
Show file tree
Hide file tree
Showing 1,574 changed files with 115,270 additions and 45,195 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.
2 changes: 2 additions & 0 deletions ISSUE_TEMPLATE.md → .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Please complete the following fields as applicable:

**What version of the DMPRoadmap code are you running? (e.g. v2.2.0)**

**Expected behaviour:**

**Actual behaviour:**
Expand Down
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/brakeman-linter-action@v1.0.0
uses: artplan1/brakeman-action@v1.2.1
with:
flags: "--color"
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14 changes: 12 additions & 2 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
name: ESLint

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

jobs:
eslint:

runs-on: ubuntu-latest

steps:
# Checkout the repo
- uses: actions/checkout@v2

# Will run ES Lint checks on javascript files
# Install Node
- uses: actions/setup-node@v2
with:
cache: 'yarn'

# Run yarn install for JS dependencies
- name: 'Yarn Install'
run: yarn install

# Run the ES Lint checks on javascript files
# https://github.com/marketplace/actions/run-eslint
- name: 'ES Lint checks'
uses: stefanoeb/eslint-action@1.0.0
Expand Down
112 changes: 36 additions & 76 deletions .github/workflows/mysql.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: Run Tests (mySQL)
name: Tests - MySQL

on: [pull_request]

jobs:
mysql:
runs-on: ubuntu-latest

# Define environment variables for MySQL and Rails
env:
DB_ADAPTER: mysql2
MYSQL_PWD: root
Expand All @@ -14,100 +15,59 @@ jobs:
steps:
# Checkout the repo
- uses: actions/checkout@v2
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 and run bundler
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6.3
bundler-cache: true

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

# 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
# Stub out the Rails credentials file so that we can start the Rails app
- name: 'Setup Credentials'
run: EDITOR='echo "$(cat config/credentials.yml.example)" >' bundle exec rails credentials:edit

# 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 }}-
# Figure out where wkhtmltopdf is installed
# Set the path to the wkhtmltopdf executable
- 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 "WICKED_PDF_PATH=`bundle exec which wkhtmltopdf`" >> $GITHUB_ENV

# Install the JS dependencies
# Run yarn install for 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`)

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

# Compile the assets
- name: 'Compile Assets'
# Start the DB server and initialize the DB
- name: 'Start MySQL'
run: |
bundle exec rake webpacker:compile RAILS_ENV=test
bundle exec rake assets:precompile RAILS_ENV=test
sudo systemctl start mysql
bin/rails db:setup RAILS_ENV=test
bin/rails db:migrate RAILS_ENV=test
# Prebuild the CSS, JS and image assets
- name: 'Precompile all of the Assets'
run: bin/rails assets:precompile

# Run the JS tests
- name: 'Run Karma Tests'
run: yarn test

# Run the unit and functional tests
- 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/
# Run the time consuming integration tests (using Chrome headless browser)
- name: 'Run Rspec Integration Tests'
run: bin/bundle exec rspec spec/features/
101 changes: 37 additions & 64 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 All @@ -23,102 +23,75 @@ jobs:
--health-timeout 5s
--health-retries 5
# Define environment variables for Postgres and Rails
env:
RAILS_ENV: test
DATABASE_URL: postgres://postgres:@localhost:5432/roadmap_test

steps:
# Checkout the repo
- uses: actions/checkout@v2

# Install Ruby and run bundler
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6.3
bundler-cache: true

# Install Node
- uses: actions/setup-node@v2
with:
fetch-depth: 1
cache: 'yarn'

# Install the necessary Postgres dev packages
# Install the Postgres developer 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'
# Stub out the Rails credentials file so that we can start the Rails app
- name: 'Setup Credentials'
run: |
gem install bundler -v 1.17.2
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3 --without mysql rollbar aws
# generate a default credential file and key
EDITOR='echo "$(cat config/credentials.yml.example)" >' bundle exec rails credentials:edit
# 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 }}-
# Figure out where wkhtmltopdf is installed
# Set the path to the wkhtmltopdf executable
- name: 'Determine wkhtmltopdf location'
run: echo ::set-env name=WICKED_PDF_PATH::$(echo `bundle exec which wkhtmltopdf`)
run: echo "WICKED_PDF_PATH=`bundle exec which wkhtmltopdf`" >> $GITHUB_ENV

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

# Migrate
- name: 'Migrate DB'
run: bundle exec rake db:migrate RAILS_ENV=test
run: |
bin/rails db:setup RAILS_ENV=test
bin/rails db:migrate RAILS_ENV=test
# Compile the assets
# Prebuild the CSS, JS and image assets
- name: 'Compile Assets'
run: |
bundle exec rake webpacker:compile
bundle exec rake assets:precompile
run: bin/rails assets:precompile

# Run the JS tests
- name: 'Run Karma Tests'
run: yarn test

# Run the unit and functional tests
- name: 'Run Rspec Unit and Functional Tests'
run: |
yarn add karma
yarn run test
bin/rspec spec/models/ spec/policies/ spec/services/ spec/helpers/
bin/rspec spec/controllers/ spec/presenters/ spec/requests/ spec/views
bin/rspec spec/mixins/
# Run the Rspec tests
- name: 'Run Rspec Tests'
run: bundle exec rspec spec/
# Run the time consuming integration tests (using Chrome headless browser)
- name: 'Run Integration Tests'
run: bin/rspec spec/features/
Loading

0 comments on commit eef511d

Please sign in to comment.