forked from External/greenlight
master #1
|
@ -1,65 +1,61 @@
|
||||||
env:
|
env:
|
||||||
RUBY_VERSION: 2.7.2
|
RUBY_VERSION: 2.7.2
|
||||||
DB_ADAPTER: postgresql
|
DB_ADAPTER: postgresql
|
||||||
DB_HOST: localhost
|
DB_HOST: localhost
|
||||||
DB_NAME: postgres
|
DB_NAME: postgres
|
||||||
DB_USERNAME: postgres
|
DB_USERNAME: postgres
|
||||||
DB_PASSWORD: postgres
|
DB_PASSWORD: postgres
|
||||||
DB_PORT: 5432
|
DB_PORT: 5432
|
||||||
|
|
||||||
name: CI
|
name: CI
|
||||||
on:
|
on: [push, pull_request]
|
||||||
push:
|
|
||||||
branches: "master"
|
jobs:
|
||||||
pull_request:
|
test:
|
||||||
branches: "*"
|
name: Rubocop + RSpec
|
||||||
|
runs-on: ubuntu-18.04
|
||||||
jobs:
|
|
||||||
test:
|
services:
|
||||||
name: Rubocop + RSpec
|
postgres:
|
||||||
runs-on: ubuntu-18.04
|
image: postgres:13.2-alpine
|
||||||
|
env:
|
||||||
services:
|
POSTGRES_DB: postgres
|
||||||
postgres:
|
POSTGRES_PASSWORD: postgres
|
||||||
image: postgres:13.2-alpine
|
POSTGRES_USER: postgres
|
||||||
env:
|
ports:
|
||||||
POSTGRES_DB: postgres
|
- 5432:5432
|
||||||
POSTGRES_PASSWORD: postgres
|
# Health checks to wait until postgres is ready
|
||||||
POSTGRES_USER: postgres
|
options: >-
|
||||||
ports:
|
--health-cmd pg_isready
|
||||||
- 5432:5432
|
--health-interval 10s
|
||||||
# Health checks to wait until postgres is ready
|
--health-timeout 5s
|
||||||
options: >-
|
--health-retries 5
|
||||||
--health-cmd pg_isready
|
steps:
|
||||||
--health-interval 10s
|
- name: Checkout
|
||||||
--health-timeout 5s
|
uses: actions/checkout@v2
|
||||||
--health-retries 5
|
|
||||||
steps:
|
- name: Install Ruby ${{ env.RUBY_VERSION }}
|
||||||
- name: Checkout
|
uses: actions/setup-ruby@v1
|
||||||
uses: actions/checkout@v2
|
with:
|
||||||
|
ruby-version: ${{ env.RUBY_VERSION }}
|
||||||
- name: Install Ruby ${{ env.RUBY_VERSION }}
|
|
||||||
uses: actions/setup-ruby@v1
|
- name: Bundle cache
|
||||||
with:
|
uses: actions/cache@v2
|
||||||
ruby-version: ${{ env.RUBY_VERSION }}
|
with:
|
||||||
|
path: vendor/bundle
|
||||||
- name: Bundle cache
|
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
|
||||||
uses: actions/cache@v2
|
restore-keys: |
|
||||||
with:
|
${{ runner.os }}-gems-
|
||||||
path: vendor/bundle
|
- name: Bundle install
|
||||||
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
|
run: |
|
||||||
restore-keys: |
|
bundle config path vendor/bundle
|
||||||
${{ runner.os }}-gems-
|
bundle install --jobs 4 --retry 3
|
||||||
- name: Bundle install
|
- name: Setup database
|
||||||
run: |
|
run: |
|
||||||
bundle config path vendor/bundle
|
bundler exec rails db:create RAILS_ENV=test
|
||||||
bundle install --jobs 4 --retry 3
|
bundler exec rails db:migrate RAILS_ENV=test
|
||||||
- name: Setup database
|
- name: Run Rubocop
|
||||||
run: |
|
run: bundle exec rubocop --parallel --fail-level F
|
||||||
bundler exec rails db:create RAILS_ENV=test
|
|
||||||
bundler exec rails db:migrate RAILS_ENV=test
|
- name: Run RSpec
|
||||||
- name: Run Rubocop
|
run: bundle exec rspec
|
||||||
run: bundle exec rubocop --parallel --fail-level F
|
|
||||||
|
|
||||||
- name: Run RSpec
|
|
||||||
run: bundle exec rspec
|
|
||||||
|
|
47
Gemfile.lock
47
Gemfile.lock
|
@ -74,28 +74,28 @@ GEM
|
||||||
attr_required (1.0.1)
|
attr_required (1.0.1)
|
||||||
autoprefixer-rails (10.2.4.0)
|
autoprefixer-rails (10.2.4.0)
|
||||||
execjs
|
execjs
|
||||||
aws-eventstream (1.1.0)
|
aws-eventstream (1.1.1)
|
||||||
aws-partitions (1.429.0)
|
aws-partitions (1.435.0)
|
||||||
aws-sdk-core (3.112.0)
|
aws-sdk-core (3.113.0)
|
||||||
aws-eventstream (~> 1, >= 1.0.2)
|
aws-eventstream (~> 1, >= 1.0.2)
|
||||||
aws-partitions (~> 1, >= 1.239.0)
|
aws-partitions (~> 1, >= 1.239.0)
|
||||||
aws-sigv4 (~> 1.1)
|
aws-sigv4 (~> 1.1)
|
||||||
jmespath (~> 1.0)
|
jmespath (~> 1.0)
|
||||||
aws-sdk-kms (1.42.0)
|
aws-sdk-kms (1.43.0)
|
||||||
aws-sdk-core (~> 3, >= 3.112.0)
|
aws-sdk-core (~> 3, >= 3.112.0)
|
||||||
aws-sigv4 (~> 1.1)
|
aws-sigv4 (~> 1.1)
|
||||||
aws-sdk-s3 (1.88.1)
|
aws-sdk-s3 (1.88.2)
|
||||||
aws-sdk-core (~> 3, >= 3.112.0)
|
aws-sdk-core (~> 3, >= 3.112.0)
|
||||||
aws-sdk-kms (~> 1)
|
aws-sdk-kms (~> 1)
|
||||||
aws-sigv4 (~> 1.1)
|
aws-sigv4 (~> 1.1)
|
||||||
aws-sigv4 (1.2.2)
|
aws-sigv4 (1.2.3)
|
||||||
aws-eventstream (~> 1, >= 1.0.2)
|
aws-eventstream (~> 1, >= 1.0.2)
|
||||||
bcrypt (3.1.16)
|
bcrypt (3.1.16)
|
||||||
bindata (2.4.8)
|
bindata (2.4.8)
|
||||||
bindex (0.8.1)
|
bindex (0.8.1)
|
||||||
bn-ldap-authentication (0.1.4)
|
bn-ldap-authentication (0.1.4)
|
||||||
net-ldap (~> 0)
|
net-ldap (~> 0)
|
||||||
bootsnap (1.7.2)
|
bootsnap (1.7.3)
|
||||||
msgpack (~> 1.0)
|
msgpack (~> 1.0)
|
||||||
bootstrap (4.3.1)
|
bootstrap (4.3.1)
|
||||||
autoprefixer-rails (>= 9.1.0)
|
autoprefixer-rails (>= 9.1.0)
|
||||||
|
@ -132,19 +132,19 @@ GEM
|
||||||
factory_bot_rails (6.1.0)
|
factory_bot_rails (6.1.0)
|
||||||
factory_bot (~> 6.1.0)
|
factory_bot (~> 6.1.0)
|
||||||
railties (>= 5.0.0)
|
railties (>= 5.0.0)
|
||||||
faker (2.16.0)
|
faker (2.17.0)
|
||||||
i18n (>= 1.6, < 2)
|
i18n (>= 1.6, < 2)
|
||||||
faraday (1.3.0)
|
faraday (1.3.0)
|
||||||
faraday-net_http (~> 1.0)
|
faraday-net_http (~> 1.0)
|
||||||
multipart-post (>= 1.2, < 3)
|
multipart-post (>= 1.2, < 3)
|
||||||
ruby2_keywords
|
ruby2_keywords
|
||||||
faraday-net_http (1.0.1)
|
faraday-net_http (1.0.1)
|
||||||
ffi (1.14.2)
|
ffi (1.15.0)
|
||||||
font-awesome-sass (5.9.0)
|
font-awesome-sass (5.9.0)
|
||||||
sassc (>= 1.11)
|
sassc (>= 1.11)
|
||||||
globalid (0.4.2)
|
globalid (0.4.2)
|
||||||
activesupport (>= 4.2.0)
|
activesupport (>= 4.2.0)
|
||||||
google-apis-core (0.2.1)
|
google-apis-core (0.3.0)
|
||||||
addressable (~> 2.5, >= 2.5.1)
|
addressable (~> 2.5, >= 2.5.1)
|
||||||
googleauth (~> 0.14)
|
googleauth (~> 0.14)
|
||||||
httpclient (>= 2.8.1, < 3.0)
|
httpclient (>= 2.8.1, < 3.0)
|
||||||
|
@ -154,16 +154,16 @@ GEM
|
||||||
rexml
|
rexml
|
||||||
signet (~> 0.14)
|
signet (~> 0.14)
|
||||||
webrick
|
webrick
|
||||||
google-apis-iamcredentials_v1 (0.1.0)
|
google-apis-iamcredentials_v1 (0.2.0)
|
||||||
google-apis-core (~> 0.1)
|
google-apis-core (~> 0.1)
|
||||||
google-apis-storage_v1 (0.2.0)
|
google-apis-storage_v1 (0.3.0)
|
||||||
google-apis-core (~> 0.1)
|
google-apis-core (~> 0.1)
|
||||||
google-cloud-core (1.5.0)
|
google-cloud-core (1.6.0)
|
||||||
google-cloud-env (~> 1.0)
|
google-cloud-env (~> 1.0)
|
||||||
google-cloud-errors (~> 1.0)
|
google-cloud-errors (~> 1.0)
|
||||||
google-cloud-env (1.4.0)
|
google-cloud-env (1.5.0)
|
||||||
faraday (>= 0.17.3, < 2.0)
|
faraday (>= 0.17.3, < 2.0)
|
||||||
google-cloud-errors (1.0.1)
|
google-cloud-errors (1.1.0)
|
||||||
google-cloud-storage (1.30.0)
|
google-cloud-storage (1.30.0)
|
||||||
addressable (~> 2.5)
|
addressable (~> 2.5)
|
||||||
digest-crc (~> 0.4)
|
digest-crc (~> 0.4)
|
||||||
|
@ -172,7 +172,7 @@ GEM
|
||||||
google-cloud-core (~> 1.2)
|
google-cloud-core (~> 1.2)
|
||||||
googleauth (~> 0.9)
|
googleauth (~> 0.9)
|
||||||
mini_mime (~> 1.0)
|
mini_mime (~> 1.0)
|
||||||
googleauth (0.15.1)
|
googleauth (0.16.0)
|
||||||
faraday (>= 0.17.3, < 2.0)
|
faraday (>= 0.17.3, < 2.0)
|
||||||
jwt (>= 1.4, < 3.0)
|
jwt (>= 1.4, < 3.0)
|
||||||
memoist (~> 0.16)
|
memoist (~> 0.16)
|
||||||
|
@ -202,7 +202,7 @@ GEM
|
||||||
aes_key_wrap
|
aes_key_wrap
|
||||||
bindata
|
bindata
|
||||||
jwt (2.2.2)
|
jwt (2.2.2)
|
||||||
listen (3.4.1)
|
listen (3.5.0)
|
||||||
rb-fsevent (~> 0.10, >= 0.10.3)
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
||||||
rb-inotify (~> 0.9, >= 0.9.10)
|
rb-inotify (~> 0.9, >= 0.9.10)
|
||||||
local_time (2.1.0)
|
local_time (2.1.0)
|
||||||
|
@ -220,7 +220,8 @@ GEM
|
||||||
mimemagic (~> 0.3.2)
|
mimemagic (~> 0.3.2)
|
||||||
memoist (0.16.2)
|
memoist (0.16.2)
|
||||||
method_source (1.0.0)
|
method_source (1.0.0)
|
||||||
mimemagic (0.3.6)
|
mimemagic (0.3.8)
|
||||||
|
nokogiri (~> 1)
|
||||||
mini_mime (1.0.2)
|
mini_mime (1.0.2)
|
||||||
mini_portile2 (2.5.0)
|
mini_portile2 (2.5.0)
|
||||||
minitest (5.14.4)
|
minitest (5.14.4)
|
||||||
|
@ -229,12 +230,12 @@ GEM
|
||||||
multi_xml (0.6.0)
|
multi_xml (0.6.0)
|
||||||
multipart-post (2.1.1)
|
multipart-post (2.1.1)
|
||||||
net-ldap (0.17.0)
|
net-ldap (0.17.0)
|
||||||
nio4r (2.5.5)
|
nio4r (2.5.7)
|
||||||
nokogiri (1.11.1)
|
nokogiri (1.11.2)
|
||||||
mini_portile2 (~> 2.5.0)
|
mini_portile2 (~> 2.5.0)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
oauth (0.5.5)
|
oauth (0.5.5)
|
||||||
oauth2 (1.4.4)
|
oauth2 (1.4.7)
|
||||||
faraday (>= 0.8, < 2.0)
|
faraday (>= 0.8, < 2.0)
|
||||||
jwt (>= 1.0, < 3.0)
|
jwt (>= 1.0, < 3.0)
|
||||||
multi_json (~> 1.3)
|
multi_json (~> 1.3)
|
||||||
|
@ -389,7 +390,7 @@ GEM
|
||||||
sequel (5.41.0)
|
sequel (5.41.0)
|
||||||
shoulda-matchers (3.1.3)
|
shoulda-matchers (3.1.3)
|
||||||
activesupport (>= 4.0.0)
|
activesupport (>= 4.0.0)
|
||||||
signet (0.14.1)
|
signet (0.15.0)
|
||||||
addressable (~> 2.3)
|
addressable (~> 2.3)
|
||||||
faraday (>= 0.17.3, < 2.0)
|
faraday (>= 0.17.3, < 2.0)
|
||||||
jwt (>= 1.5, < 3.0)
|
jwt (>= 1.5, < 3.0)
|
||||||
|
@ -449,7 +450,7 @@ GEM
|
||||||
webfinger (1.1.0)
|
webfinger (1.1.0)
|
||||||
activesupport
|
activesupport
|
||||||
httpclient (>= 2.4)
|
httpclient (>= 2.4)
|
||||||
webmock (3.11.2)
|
webmock (3.12.1)
|
||||||
addressable (>= 2.3.6)
|
addressable (>= 2.3.6)
|
||||||
crack (>= 0.3.2)
|
crack (>= 0.3.2)
|
||||||
hashdiff (>= 0.4.0, < 2.0.0)
|
hashdiff (>= 0.4.0, < 2.0.0)
|
||||||
|
|
|
@ -89,7 +89,7 @@ class SessionsController < ApplicationController
|
||||||
return redirect_to(root_path, alert: I18n.t("invalid_login_method")) unless user.greenlight_account?
|
return redirect_to(root_path, alert: I18n.t("invalid_login_method")) unless user.greenlight_account?
|
||||||
# Check that the user has verified their account
|
# Check that the user has verified their account
|
||||||
unless user.activated?
|
unless user.activated?
|
||||||
user.create_activation_token if user.activation_digest.nil?
|
user.create_activation_token if user.activation_digest.nil?
|
||||||
return redirect_to(account_activation_path(digest: user.activation_digest))
|
return redirect_to(account_activation_path(digest: user.activation_digest))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue