Skip to content

Commit f6c6d6c

Browse files
authored
Merge pull request #109 from DigitalCurationCentre/deploy/uat
Merge Release-candidate to Release branch
2 parents abed290 + e4c482d commit f6c6d6c

70 files changed

Lines changed: 12235 additions & 11372 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/brakeman.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Brakeman
2+
3+
on:
4+
pull_request:
5+
branches:
6+
master
7+
8+
jobs:
9+
brakeman:
10+
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v1
15+
16+
# Will run Brakeman checks on dependencies
17+
# https://github.com/marketplace/actions/brakeman-linter
18+
- name: Brakeman
19+
uses: devmasx/[email protected]
20+
env:
21+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/eslint.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: ESLint
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
eslint:
7+
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v1
12+
13+
# Will run ES Lint checks on javascript files
14+
# https://github.com/marketplace/actions/run-eslint
15+
- name: 'ES Lint checks'
16+
uses: stefanoeb/[email protected]
17+
with:
18+
args: './app/javascript/**/*.js'

.github/workflows/mysql.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Run Tests (mySQL)
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
mysql:
7+
runs-on: ubuntu-latest
8+
9+
env:
10+
DB_ADAPTER: mysql2
11+
MYSQL_PWD: root
12+
RAILS_ENV: test
13+
14+
steps:
15+
# Checkout the repo
16+
- uses: actions/checkout@v1
17+
with:
18+
fetch-depth: 1
19+
20+
# Install the necessary MySQL dev packages
21+
- name: 'Install Mysql Packages'
22+
run: |
23+
sudo apt-get update
24+
sudo apt-get install -y mysql-client libmysqlclient-dev
25+
26+
# Extract the Ruby version from the Gemfile.lock
27+
- name: 'Determine Ruby Version'
28+
run: echo ::set-env name=RUBY_VERSION::$(echo `cat ./Gemfile.lock | grep -A 1 'RUBY VERSION' | grep 'ruby' | grep -oE '[0-9]\.[0-9]'`)
29+
30+
# Install Ruby - using the version found in the Gemfile.lock
31+
- name: 'Install Ruby'
32+
uses: actions/setup-ruby@v1
33+
with:
34+
ruby-version: ${{ env.RUBY_VERSION }}
35+
36+
# Copy all of the example configs over
37+
- name: 'Setup Default Configuration'
38+
run: |
39+
# Make copies of all the example config files
40+
cp config/branding.yml.sample config/branding.yml
41+
cp config/database.yml.sample config/database.yml
42+
cp config/secrets.yml.sample config/secrets.yml
43+
cp config/initializers/contact_us.rb.example config/initializers/contact_us.rb
44+
cp config/initializers/devise.rb.example config/initializers/devise.rb
45+
cp config/initializers/recaptcha.rb.example config/initializers/recaptcha.rb
46+
cp config/initializers/wicked_pdf.rb.example config/initializers/wicked_pdf.rb
47+
48+
# Try to retrieve the gems from the cache
49+
- name: 'Cache Gems'
50+
uses: actions/cache@v1
51+
with:
52+
path: vendor/bundle
53+
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
54+
restore-keys: |
55+
${{ runner.os }}-gem-
56+
57+
# Install bundler and run bundle install
58+
- name: 'Bundle Install'
59+
run: |
60+
gem install bundler -v 1.17.2
61+
bundle config path vendor/bundle
62+
bundle install --jobs 4 --retry 3 --without pgsql rollbar aws
63+
64+
# Try to retrieve the yarn JS dependencies from the cache
65+
- name: 'Cache Yarn Packages'
66+
uses: actions/cache@v1
67+
with:
68+
path: node_modules/
69+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
70+
restore-keys: |
71+
${{ runner.os }}-build-${{ env.cache-name }}-
72+
${{ runner.os }}-build-
73+
${{ runner.os }}-yarn-
74+
${{ runner.os }}-
75+
76+
# Install the JS dependencies
77+
- name: 'Yarn Install'
78+
run: |
79+
yarn install
80+
81+
# Figure out where wkhtmltopdf is installed
82+
- name: 'Determine wkhtmltopdf location'
83+
run: echo ::set-env name=WICKED_PDF_PATH::$(echo `bundle exec which wkhtmltopdf`)
84+
85+
# Setup the database
86+
- name: 'Setup Test DB'
87+
run: bundle exec rake db:setup RAILS_ENV=test
88+
89+
# Compile the assets
90+
- name: 'Compile Assets'
91+
run: |
92+
bundle exec rake webpacker:compile RAILS_ENV=test
93+
bundle exec rake assets:precompile RAILS_ENV=test
94+
95+
# Run the JS tests
96+
- name: 'Run Karma Tests'
97+
run: |
98+
yarn add karma
99+
yarn run test
100+
101+
# Run the Rspec tests
102+
- name: 'Run Rspec Tests'
103+
run: bundle exec rspec spec/

.github/workflows/postgres.yml

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
name: Run Tests (postgreSQL)
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
postgresql:
7+
runs-on: ubuntu-latest
8+
9+
services:
10+
# Postgres installation
11+
db:
12+
image: postgres
13+
env:
14+
# Latest version of Postgres has increased security. We can use the default
15+
# user/password in this testing scenario though so use the following env
16+
# variable to bypass this changes:
17+
# https://github.com/docker-library/postgres/issues/681
18+
POSTGRES_HOST_AUTH_METHOD: trust
19+
ports: ['5432:5432']
20+
options: >-
21+
--health-cmd pg_isready
22+
--health-interval 10s
23+
--health-timeout 5s
24+
--health-retries 5
25+
26+
env:
27+
RAILS_ENV: test
28+
DATABASE_URL: postgres://postgres:@localhost:5432/roadmap_test
29+
WICKED_PDF_PATH: vendor/bundle/bin/wkhtmltopdf
30+
31+
steps:
32+
# Checkout the repo
33+
- uses: actions/checkout@v1
34+
with:
35+
fetch-depth: 1
36+
37+
# Install the necessary Postgres dev packages
38+
- name: 'Install Postgresql Packages'
39+
run: |
40+
sudo apt-get update
41+
sudo apt-get install libpq-dev
42+
43+
# Extract the Ruby version from the Gemfile.lock
44+
- name: 'Determine Ruby Version'
45+
run: echo ::set-env name=RUBY_VERSION::$(echo `cat ./Gemfile.lock | grep -A 1 'RUBY VERSION' | grep 'ruby' | grep -oE '[0-9]\.[0-9]'`)
46+
47+
# Install Ruby - using the version found in the Gemfile.lock
48+
- name: 'Install Ruby'
49+
uses: actions/setup-ruby@v1
50+
with:
51+
ruby-version: ${{ env.RUBY_VERSION }}
52+
53+
# Copy all of the example configs over
54+
- name: 'Setup Default Configuration'
55+
run: |
56+
# Make copies of all the example config files
57+
cp config/branding.yml.sample config/branding.yml
58+
cp config/database.yml.sample config/database.yml
59+
cp config/secrets.yml.sample config/secrets.yml
60+
cp config/initializers/contact_us.rb.example config/initializers/contact_us.rb
61+
cp config/initializers/devise.rb.example config/initializers/devise.rb
62+
cp config/initializers/recaptcha.rb.example config/initializers/recaptcha.rb
63+
cp config/initializers/wicked_pdf.rb.example config/initializers/wicked_pdf.rb
64+
65+
# Try to retrieve the gems from the cache
66+
- name: 'Cache Gems'
67+
uses: actions/cache@v1
68+
with:
69+
path: vendor/bundle
70+
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
71+
restore-keys: |
72+
${{ runner.os }}-gem-
73+
74+
# Install bundler and run bundle install
75+
- name: 'Bundle Install'
76+
run: |
77+
gem install bundler -v 1.17.2
78+
bundle config path vendor/bundle
79+
bundle install --jobs 4 --retry 3 --without mysql rollbar aws
80+
81+
# Try to retrieve the yarn JS dependencies from the cache
82+
- name: 'Cache Yarn Packages'
83+
uses: actions/cache@v1
84+
with:
85+
path: node_modules/
86+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
87+
restore-keys: |
88+
${{ runner.os }}-build-${{ env.cache-name }}-
89+
${{ runner.os }}-build-
90+
${{ runner.os }}-yarn-
91+
${{ runner.os }}-
92+
93+
# Figure out where wkhtmltopdf is installed
94+
- name: 'Determine wkhtmltopdf location'
95+
run: echo ::set-env name=WICKED_PDF_PATH::$(echo `bundle exec which wkhtmltopdf`)
96+
97+
# Install the JS dependencies
98+
- name: 'Yarn Install'
99+
run: |
100+
yarn install
101+
102+
# Setup the database
103+
- name: 'Setup Test DB'
104+
run: bundle exec rake db:setup RAILS_ENV=test
105+
106+
# Compile the assets
107+
- name: 'Compile Assets'
108+
run: |
109+
bundle exec rake webpacker:compile
110+
bundle exec rake assets:precompile
111+
112+
# Run the JS tests
113+
- name: 'Run Karma Tests'
114+
run: |
115+
yarn add karma
116+
yarn run test
117+
118+
# Run the Rspec tests
119+
- name: 'Run Rspec Tests'
120+
run: bundle exec rspec spec/

.github/workflows/rubocop.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Commented out until we have time to do a full cleanup of the codebase
2+
3+
name: Rubocop
4+
5+
on: [pull_request]
6+
7+
jobs:
8+
rubocop:
9+
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v1
14+
15+
# Extract the Ruby version from the Gemfile.lock
16+
# - name: 'Determine Ruby Version'
17+
# run: echo ::set-env name=RUBY_VERSION::$(echo `cat ./Gemfile.lock | grep -A 1 'RUBY VERSION' | grep 'ruby' | grep -oE '[0-9]\.[0-9]'`)
18+
19+
# Install Ruby - using the version found in the Gemfile.lock
20+
# - name: 'Install Ruby'
21+
# uses: actions/setup-ruby@v1
22+
# with:
23+
# ruby-version: ${{ env.RUBY_VERSION }}
24+
25+
# Will run Rubocop checks on the PR diffs and report any errors as commentary on the PR
26+
# https://github.com/marketplace/actions/octocop
27+
# - name: Octocop
28+
# uses: Freshly/[email protected]
29+
# with:
30+
# github_token: ${{ secrets.github_token }}
31+
# additional-gems: 'rubocop-dmp_roadmap'
32+
33+
- name: 'Placeholder for Rubocop'
34+
run: echo "Rubocop has been temporarily disabled"

0 commit comments

Comments
 (0)