Skip to content
This repository was archived by the owner on Nov 6, 2021. It is now read-only.

Commit ed2c5c9

Browse files
First pass at adding github workflows. (#509)
* First pass at adding github workflows. * Add env var to .env.test file * Relax conditions for stubbing http request Co-authored-by: Nick Schimek <19519317+NickSchimek@users.noreply.github.com>
1 parent 318114a commit ed2c5c9

67 files changed

Lines changed: 428 additions & 145 deletions

Some content is hidden

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

.env.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
DIAPER_KEY="testapikey"
2+
DIAPERBANK_ENDPOINT="https://diaper.test"

.github/workflows/brakeman.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: brakeman
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
brakeman:
13+
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
19+
- name: Set up Ruby
20+
uses: ruby/setup-ruby@v1
21+
with:
22+
bundler-cache: true
23+
24+
- name: run brakeman
25+
run: bundle exec brakeman

.github/workflows/erb_lint.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: ERB lint
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths-ignore:
8+
- 'docs/**'
9+
- '*.md'
10+
- 'bin/*'
11+
pull_request:
12+
branches:
13+
- main
14+
paths-ignore:
15+
- 'docs/**'
16+
- '*.md'
17+
- 'bin/*'
18+
19+
jobs:
20+
erb_lint:
21+
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- uses: actions/checkout@v2
26+
27+
- name: Set up Ruby
28+
uses: ruby/setup-ruby@v1
29+
30+
- name: install gem erb_lint
31+
run: gem install erb_lint -v 0.0.35
32+
33+
- name: ERB lint
34+
run: erblint --lint-all --autocorrect

.github/workflows/rspec-push.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: rspec
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths-ignore:
8+
- 'docs/**'
9+
- '*.md'
10+
- 'bin/*'
11+
12+
jobs:
13+
rspec:
14+
15+
runs-on: ubuntu-latest
16+
17+
services:
18+
db:
19+
image: postgres:12.3
20+
env:
21+
POSTGRES_PASSWORD: password
22+
ports:
23+
- 5432:5432
24+
options: >-
25+
--health-cmd pg_isready
26+
--health-interval 10s
27+
--health-timeout 5s
28+
--health-retries 5
29+
steps:
30+
- uses: actions/checkout@v2
31+
32+
- name: Set up Ruby
33+
uses: ruby/setup-ruby@v1
34+
with:
35+
bundler-cache: true
36+
37+
- name: Install PostgreSQL client
38+
run: |
39+
sudo apt-get -yqq install libpq-dev
40+
- name: Build App
41+
env:
42+
POSTGRES_HOST: localhost
43+
DATABASE_HOST: localhost
44+
POSTGRES_USER: postgres
45+
PARTNER_DATABASE_PASSWORD: password
46+
POSTGRES_PASSWORD: password
47+
POSTGRES_HOST_AUTH_METHOD: trust
48+
POSTGRES_PORT: 5432
49+
run: |
50+
bundle exec skylight disable_dev_warning
51+
yarn
52+
bundle exec rake db:create
53+
bundle exec rake db:schema:load
54+
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
55+
chmod +x ./cc-test-reporter
56+
./cc-test-reporter before-build
57+
- name: Run rspec
58+
env:
59+
POSTGRES_HOST: localhost
60+
DATABASE_HOST: localhost
61+
POSTGRES_USER: postgres
62+
PARTNER_DATABASE_PASSWORD: password
63+
POSTGRES_PASSWORD: password
64+
POSTGRES_HOST_AUTH_METHOD: trust
65+
POSTGRES_PORT: 5432
66+
PGHOST: localhost
67+
PGUSER: postgres
68+
RAILS_ENV: test
69+
run: |
70+
RUBYOPT='-W:no-deprecated -W:no-experimental' bundle exec rspec
71+
- name: Deploy via capistrano
72+
uses: miloserdow/capistrano-deploy@master
73+
env:
74+
BRANCH: main
75+
with:
76+
target: staging
77+
deploy_key: ${{ secrets.DEPLOY_ENC_KEY }}

.github/workflows/rspec.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: rspec
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
paths-ignore:
8+
- 'docs/**'
9+
- '*.md'
10+
- 'bin/*'
11+
12+
jobs:
13+
rspec:
14+
15+
runs-on: ubuntu-latest
16+
17+
services:
18+
db:
19+
image: postgres:12.3
20+
env:
21+
POSTGRES_PASSWORD: password
22+
ports:
23+
- 5432:5432
24+
options: >-
25+
--health-cmd pg_isready
26+
--health-interval 10s
27+
--health-timeout 5s
28+
--health-retries 5
29+
steps:
30+
- uses: actions/checkout@v2
31+
32+
- name: Set up Ruby
33+
uses: ruby/setup-ruby@v1
34+
with:
35+
bundler-cache: true
36+
37+
- name: Install PostgreSQL client
38+
run: |
39+
sudo apt-get -yqq install libpq-dev
40+
- name: Build App
41+
env:
42+
POSTGRES_HOST: localhost
43+
DATABASE_HOST: localhost
44+
POSTGRES_USER: postgres
45+
PARTNER_DATABASE_PASSWORD: password
46+
POSTGRES_PASSWORD: password
47+
POSTGRES_HOST_AUTH_METHOD: trust
48+
POSTGRES_PORT: 5432
49+
run: |
50+
bundle exec skylight disable_dev_warning
51+
yarn
52+
bundle exec rake db:create
53+
bundle exec rake db:schema:load
54+
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
55+
chmod +x ./cc-test-reporter
56+
./cc-test-reporter before-build
57+
- name: Run rspec
58+
env:
59+
POSTGRES_HOST: localhost
60+
DATABASE_HOST: localhost
61+
POSTGRES_USER: postgres
62+
PARTNER_DATABASE_PASSWORD: password
63+
POSTGRES_PASSWORD: password
64+
POSTGRES_HOST_AUTH_METHOD: trust
65+
POSTGRES_PORT: 5432
66+
PGHOST: localhost
67+
PGUSER: postgres
68+
RAILS_ENV: test
69+
run: |
70+
RUBYOPT='-W:no-deprecated -W:no-experimental' bundle exec rspec

.github/workflows/ruby_lint.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: rubocop lint
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths-ignore:
8+
- 'docs/**'
9+
- '*.md'
10+
- 'bin/*'
11+
pull_request:
12+
branches:
13+
- main
14+
paths-ignore:
15+
- 'docs/**'
16+
- '*.md'
17+
- 'bin/*'
18+
19+
jobs:
20+
ruby_lint:
21+
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- uses: actions/checkout@v2
26+
27+
- name: Set up Ruby
28+
uses: ruby/setup-ruby@v1
29+
with:
30+
bundler-cache: true
31+
32+
- name: lint
33+
run: bundle exec rubocop

.travis.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,19 @@ gem "pundit", "~> 2.1.0"
2525
gem "rails", "~> 6.0.3"
2626
gem "sass-rails", "~> 6.0"
2727
gem "simple_form"
28+
gem "skylight"
2829
gem "uglifier", ">= 1.3.0"
2930
gem "wicked_pdf", "~> 2.1"
3031
gem "wkhtmltopdf-binary"
3132

3233
group :development, :test do
3334
gem "better_errors"
3435
gem "binding_of_caller"
36+
gem "brakeman"
3537
gem "byebug", platforms: [:mri, :mingw, :x64_mingw]
3638
gem "capybara-screenshot"
3739
gem "dotenv-rails"
40+
gem "erb_lint", require: false
3841
gem "factory_bot_rails"
3942
gem "faker"
4043
gem "guard-rspec"

Gemfile.lock

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ GEM
7171
coderay (>= 1.0.0)
7272
erubi (>= 1.0.0)
7373
rack (>= 0.9.0)
74+
better_html (1.0.15)
75+
actionview (>= 4.0)
76+
activesupport (>= 4.0)
77+
ast (~> 2.0)
78+
erubi (~> 1.4)
79+
html_tokenizer (~> 0.0.6)
80+
parser (>= 2.4)
81+
smart_properties
7482
bindex (0.8.1)
7583
binding_of_caller (1.0.0)
7684
debug_inspector (>= 0.0.1)
@@ -80,6 +88,7 @@ GEM
8088
autoprefixer-rails (>= 9.1.0)
8189
popper_js (>= 1.14.3, < 2)
8290
sassc-rails (>= 2.0.0)
91+
brakeman (4.10.0)
8392
bugsnag (6.19.0)
8493
concurrent-ruby (~> 1.0)
8594
builder (3.2.4)
@@ -140,6 +149,14 @@ GEM
140149
htmlentities (~> 4.3.3)
141150
launchy (~> 2.1)
142151
mail (~> 2.7)
152+
erb_lint (0.0.35)
153+
activesupport
154+
better_html (~> 1.0.7)
155+
html_tokenizer
156+
parser (>= 2.7.1.4)
157+
rainbow
158+
rubocop (~> 0.79)
159+
smart_properties
143160
erubi (1.10.0)
144161
execjs (2.7.0)
145162
factory_bot (6.1.0)
@@ -182,6 +199,7 @@ GEM
182199
guard-compat (~> 1.1)
183200
rspec (>= 2.99.0, < 4.0)
184201
hashdiff (1.0.1)
202+
html_tokenizer (0.0.7)
185203
htmlentities (4.3.4)
186204
i18n (1.8.7)
187205
concurrent-ruby (~> 1.0)
@@ -375,7 +393,12 @@ GEM
375393
simplecov_json_formatter (~> 0.1)
376394
simplecov-html (0.12.3)
377395
simplecov_json_formatter (0.1.2)
396+
skylight (4.3.1)
397+
skylight-core (= 4.3.1)
398+
skylight-core (4.3.1)
399+
activesupport (>= 4.2.0)
378400
slop (3.6.0)
401+
smart_properties (1.15.0)
379402
spring (2.1.1)
380403
spring-watcher-listen (2.0.1)
381404
listen (>= 2.7, < 4.0)
@@ -435,6 +458,7 @@ DEPENDENCIES
435458
binding_of_caller
436459
bootsnap (>= 1.1.0)
437460
bootstrap (~> 4.5.3)
461+
brakeman
438462
bugsnag
439463
byebug
440464
capistrano-bundler
@@ -448,6 +472,7 @@ DEPENDENCIES
448472
devise_invitable
449473
dotenv-rails
450474
email_spec
475+
erb_lint
451476
factory_bot_rails
452477
faker
453478
filterrific
@@ -480,6 +505,7 @@ DEPENDENCIES
480505
shoulda-matchers
481506
simple_form
482507
simplecov
508+
skylight
483509
spring
484510
spring-watcher-listen (~> 2.0.0)
485511
tzinfo-data

app/views/authorized_family_members/_form.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@
2626
</div>
2727
</div>
2828
</div>
29-
</section>
29+
</section>

0 commit comments

Comments
 (0)