Skip to content

Commit

Permalink
Merge branch 'master' into tests/update-test-for-authentification
Browse files Browse the repository at this point in the history
  • Loading branch information
syl-p committed Feb 21, 2024
2 parents 4a0af11 + df4e788 commit 3e010e7
Show file tree
Hide file tree
Showing 44 changed files with 415 additions and 676 deletions.
6 changes: 1 addition & 5 deletions .env-example
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
SECRET_KEY_BASE=
ALLOWED_CORS_ORIGINS=*
RAILS_SERVE_STATIC_FILES=true
ENABLE_AUTHENTICATION=
DEVISE_SECRET_KEY=
DEVISE_PEPPER=
MAILER_SENDER=
DEFAULT_URL=
DEFAULT_PORT=
SANITIZED_ALLOWED_TAGS="strong b em i ul ol li br a div span img h1 h2 h3 h4 h5 h6"
SANITIZED_ALLOWED_TAGS="strong b em i ul ol li br a div span img h1 h2 h3 h4 h5 h6 p"
SANITIZED_ALLOWED_ATTRIBUTES="href style"
51 changes: 35 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: CI

on:
push:
branches: [ master, community ]
pull_request:
branches: [ master, community ]
branches: [ 'master' ]

jobs:
test:
Expand All @@ -22,20 +20,41 @@ jobs:
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
RAILS_ENV: test
DATABASE_URL: postgres://postgres:postgres@localhost:5432/pia_test
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: '3.3'
- name: Set up database schema
run: bin/rails db:schema:load
- name: Run tests
run: bin/rails test

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Ruby
uses: actions/setup-ruby@v1
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1.x
- name: Build and run tests
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/pia_test
RAILS_ENV: test
run: |
sudo apt-get -yqq install libpq-dev
gem install bundler
bundle install --jobs 4 --retry 3
bin/rails db:prepare
bin/rails test
bundler-cache: true
ruby-version: '3.3'

- name: Bundle binstubs
run: bundle install --binstubs

- name: Security audit dependencies
run: bin/bundler-audit --update

- name: Security audit application code
run: bin/brakeman

- name: Lint Ruby files
run: bin/rubocop
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ Dockerfile
/data/
.env
.DS_Store

coverage/
14 changes: 9 additions & 5 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
require: rubocop-rails
Style/FrozenStringLiteralComment:
# Omakase Ruby styling for Rails
inherit_gem:
rubocop-rails-omakase: rubocop.yml

# Your own specialized rules go here
Style/StringLiterals:
Enabled: false
Style/Documentation:
Layout/SpaceInsideArrayLiteralBrackets:
Enabled: false
Layout/LineLength:
Max: 140
Layout/EndAlignment:
EnforcedStyleAlignWith: keyword
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.3
3.3.0
16 changes: 11 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '~> 3.1.3'
ruby '~> 3.1'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'fast_jsonapi'
Expand All @@ -10,10 +10,10 @@ gem 'rails', '~> 7.0.3'
gem 'pg', '>= 0.18', '< 2.0'
# Use Puma as the app server
gem 'mime-types', '~> 3.3'
gem 'puma', '~> 4.3'
gem 'puma', '~> 5.6'

gem 'carrierwave', '~> 2.1.1'
gem 'carrierwave-base64', '~> 2.8.0'
gem 'carrierwave'
gem 'carrierwave-base64'
gem 'dotenv-rails'

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
Expand Down Expand Up @@ -50,17 +50,23 @@ gem 'rails-i18n'

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'brakeman'
gem 'bundler-audit'
gem 'byebug', platform: %i[mri mingw x64_mingw]
gem 'factory_bot_rails'
gem 'rubocop'
gem 'rubocop-rails', require: false
end

group :development do
# gem 'listen', '~> 3.2.1'
gem 'rubocop-rails', require: false
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
# gem 'spring'
# gem 'spring-watcher-listen', '~> 2.0.0'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]
gem "rubocop-rails-omakase", require: false, group: [ :development ]

gem 'simplecov', require: false, group: :test
Loading

0 comments on commit 3e010e7

Please sign in to comment.