-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from fabianoflorentino/development
Development to Main
- Loading branch information
Showing
81 changed files
with
1,913 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# See https://docs.docker.com/engine/reference/builder/#dockerignore-file for more about ignoring files. | ||
|
||
# Ignore git directory. | ||
/.git/ | ||
|
||
# Ignore bundler config. | ||
/.bundle | ||
|
||
# Ignore all environment files (except templates). | ||
/.env* | ||
!/.env*.erb | ||
|
||
# Ignore all default key files. | ||
/config/master.key | ||
/config/credentials/*.key | ||
|
||
# Ignore all logfiles and tempfiles. | ||
/log/* | ||
/tmp/* | ||
!/log/.keep | ||
!/tmp/.keep | ||
|
||
# Ignore pidfiles, but keep the directory. | ||
/tmp/pids/* | ||
!/tmp/pids/.keep | ||
|
||
# Ignore storage (uploaded files in development and any SQLite databases). | ||
/storage/* | ||
!/storage/.keep | ||
/tmp/storage/* | ||
!/tmp/storage/.keep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# See https://git-scm.com/docs/gitattributes for more about git attribute files. | ||
|
||
# Mark the database schema as having been generated. | ||
db/schema.rb linguist-generated | ||
|
||
# Mark any vendored files as having been vendored. | ||
vendor/* linguist-vendored | ||
config/credentials/*.yml.enc diff=rails_credentials | ||
config/credentials.yml.enc diff=rails_credentials |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
|
||
name: Brakeman | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- development | ||
pull_request: | ||
branches: | ||
- main | ||
- development | ||
|
||
jobs: | ||
brakeman: | ||
name: Brakeman Security Scan | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
pull-requests: read | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Dependences | ||
run: | | ||
sudo apt-get update -y | ||
sudo apt-get install -y libpq-dev postgresql-client build-essential libssl-dev | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 3.2.3 | ||
|
||
- name: Bundle Install | ||
run: bundle install | ||
|
||
- name: Brakeman Security Scan | ||
run: brakeman -z -o brakeman-output.json | ||
|
||
- name: Upload Brakeman Report | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: brakeman-report | ||
path: brakeman-output.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
--- | ||
name: RSpec | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- development | ||
pull_request: | ||
branches: | ||
- main | ||
- development | ||
|
||
jobs: | ||
rspec: | ||
name: Unit Tests with RSepc | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
pull-requests: read | ||
env: | ||
RAILS_ENV: development | ||
RAILS_MAX_THREADS: 2 | ||
WEB_CONCURRENCY: 2 | ||
POSTGRES_HOST: localhost | ||
POSTGRES_PORT: '5432' | ||
POSTGRES_USER: ${{ secrets.POSTGRES_USER }} | ||
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} | ||
POSTGRES_DB: ${{ secrets.POSTGRES_DB }} | ||
services: | ||
postgres: | ||
image: postgres:latest | ||
env: | ||
POSTGRES_HOST: localhost | ||
POSTGRES_PORT: '5432' | ||
POSTGRES_USER: ${{ secrets.POSTGRES_USER }} | ||
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} | ||
POSTGRES_DB: ${{ secrets.POSTGRES_DB }} | ||
POSTGRES_MAX_CONNECTIONS: '30' | ||
POSTGRES_RANDOM_PAGE_COST: '1.1' | ||
POSTGRES_EFFECTIVE_IO_CONCURRENCY: '30' | ||
ports: | ||
- 5432:5432 | ||
options: --health-cmd pg_isready --health-interval 5s --health-timeout 5s --health-retries 3 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Dependences | ||
run: | | ||
sudo apt-get update -y | ||
sudo apt-get install -y libpq-dev postgresql-client build-essential libssl-dev | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 3.2.3 | ||
|
||
- name: Bundle Install | ||
run: bundle install | ||
|
||
- name: Database Setup | ||
run: | | ||
bundle exec rails db:migrate | ||
- name: Run RSpec | ||
run: bundle exec rspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--color | ||
--require spec_helper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
|
||
AllCops: | ||
NewCops: enable | ||
|
||
require: | ||
- rubocop-rails | ||
- rubocop-performance | ||
- rubocop-rspec | ||
- rubocop-factory_bot | ||
|
||
Metrics/BlockLength: | ||
Enabled: false | ||
|
||
RSpec/MultipleExpectations: | ||
Enabled: false | ||
|
||
RSpec/ExampleLength: | ||
Enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ruby-3.2.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM ruby:3.2.3-alpine3.19 | ||
|
||
LABEL maintainer="Fabiano Santos Florentino" | ||
LABEL version="0.1" | ||
LABEL description="Docker image for Ruby on Rails development" | ||
LABEL appname="Black Pearl" | ||
|
||
ENV PATH="/usr/local/bundle/bin:${PATH}" | ||
ENV RUBY_YJIT_ENABLE=1 | ||
|
||
COPY . /app | ||
|
||
WORKDIR /app | ||
|
||
RUN apk update && apk upgrade --no-cache \ | ||
&& apk add --no-cache libpq-dev build-base git bash tzdata gcompat postgresql \ | ||
&& gem install rails railties bundler \ | ||
&& bundle install --jobs 2 --no-cache \ | ||
&& bundle exec bootsnap precompile | ||
|
||
EXPOSE 3000 | ||
|
||
CMD ["bash", "-c", "bundle exec rails s -b 0.0.0.0 -p 3000"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# frozen_string_literal: true | ||
|
||
source 'https://rubygems.org' | ||
|
||
ruby '3.2.3' | ||
|
||
gem 'rails', '~> 7.1.3', '>= 7.1.3.2' | ||
|
||
gem 'bootsnap', require: false | ||
gem 'jsonapi-serializer', '~> 2.2.0' | ||
gem 'pg', '~> 1.1' | ||
gem 'puma', '>= 5.0' | ||
gem 'tzinfo-data', '~> 1.2024', '>= 1.2024.1' | ||
|
||
group :development, :test do | ||
gem 'brakeman', '~> 6.0.1', require: false | ||
gem 'debug' | ||
gem 'factory_bot_rails', '~> 6.2.0' | ||
gem 'faker', '~> 3.2.0' | ||
gem 'rspec', '~> 3.13' | ||
gem 'rspec-rails', '~> 6.1', '>= 6.1.1' | ||
gem 'rubocop', '~> 1.61.0' | ||
gem 'rubocop-performance', '~> 1.20.0' | ||
gem 'rubocop-rails', '~> 2.23.1' | ||
gem 'rubocop-rspec', '~> 2.27.0' | ||
gem 'rubocop-shopify', '~> 2.15.1' | ||
gem 'shoulda-matchers', '~> 5.3' | ||
end |
Oops, something went wrong.