Skip to content

Commit

Permalink
teste ci
Browse files Browse the repository at this point in the history
  • Loading branch information
MtsSrs committed Jul 16, 2023
0 parents commit e325292
Show file tree
Hide file tree
Showing 968 changed files with 198,816 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ALLOW_HOSTS=/.*/
DATABASE_USERNAME=postgres
DATABASE_PASSWORD=postgres
REDIS_CACHE_URL=redis://redis-cache:6380
REDIS_URL=redis://redis-queue:6379
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
app/views/static/** linguist-documentation
125 changes: 125 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
name: CI

on:
push:
branches:
- '#3-CI'
pull_request:
branches:
- '#3-CI'

jobs:
test:
runs-on: ubuntu-latest

services:
postgres:
image: postgres:13.2-alpine
env:
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: --health-cmd "pg_isready -U postgres || exit 1" --health-interval 10s --health-timeout 5s --health-retries 3

redis-queue:
image: redis:6.0.12-alpine
ports:
- 6379:6379
options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 3

redis-cache:
image: redis:6.0.12-alpine
ports:
- 6380:6379
options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 3

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.4

- name: Install dependencies
run: |
sudo apt update && sudo apt upgrade -y
gem install bundler
bundle install
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 16

- name: Install Node.js dependencies
run: |
curl -sL https://deb.nodesource.com/setup_16.x | sudo bash -
sudo apt-get install -y nodejs
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null
echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install -y yarn
npm install
yarn
- name: Run tests on rspec
run: |
bundle exec rspec
- name: Run mailer tests
run: |
bundle exec rspec test/mailers/app_mailer_test.rb
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.4

- name: Install dependencies
run: |
sudo apt update && sudo apt upgrade -y
gem install bundler
bundle install
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 16

- name: Install Node.js dependencies
run: |
curl -sL https://deb.nodesource.com/setup_16.x | sudo bash -
sudo apt-get install -y nodejs
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null
echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install -y yarn
npm install
yarn
- name: Run RuboCop
continue-on-error: true
run: |
bundle exec rubocop
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Docker compose
run: |
sudo apt-get update
sudo apt-get -y install
- name: Build Docker image
run: docker-compose build
37 changes: 37 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'

# Ignore bundler config.
/.bundle

# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep

# Ignore uploaded files in development
/storage/*
!/storage/.keep

# Ignore master key for decrypting credentials and more.
/config/master.key

/config/puma.production.rb
.ruby-gemset
.byebug_history

public/assets
public/uploads
public/decidim-packs
public/packs
public/packs-test
public/sw.js*
/node_modules
/yarn-error.log
yarn-debug.log*
.yarn-integrity
package-lock.json
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0.4
44 changes: 44 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Imagem base do Ruby
FROM ruby:3.0.4

# Criando diretório de trabalho
WORKDIR /user/app

# Instalando dependências
RUN apt update && apt upgrade -y
RUN gem install rails bundler

# Instalando o Node
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash -
RUN apt-get install -y nodejs
RUN curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee /usr/share/keyrings/yarnkey.gpg >/dev/null
RUN echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update && apt-get install -y yarn

# Instalando pacote PostgreSQL
RUN apt-get install -y libpq-dev

# Copiando as gemfiles
COPY Gemfile* /user/app/

# Copiando o projeto para o contêiner
COPY . .

# Instalando dependências
RUN bundle install

# Instalando NPM e Yarn
RUN npm install
RUN yarn

# Instalando o mailcatcher
RUN gem install mailcatcher --no-document

# Expondo a porta para uso
EXPOSE 3000
EXPOSE 1025
EXPOSE 1080

# Inicialização
CMD rails db:create db:migrate && rails server -b 0.0.0.0 -d && mailcatcher --ip=0.0.0.0 && bundle exec sidekiq

56 changes: 56 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# frozen_string_literal: true

source 'https://rubygems.org'

git_source(:github) { |repo| "https://github.com/#{repo}.git" }
git_source(:gitlab) { |repo| "https://gitlab.com/#{repo}.git" }

ruby RUBY_VERSION

DECIDIM_VERSION = '0.27.2'

# CALENDAR_REPO = { path: '../decidim-module-calendar' }.freeze
CALENDAR_REPO = { gitlab: 'nomadetec/decidim-module-calendar' }.freeze

gem 'decidim', DECIDIM_VERSION
gem 'decidim-calendar', CALENDAR_REPO
gem 'decidim-conferences', DECIDIM_VERSION
gem 'decidim-consultations', DECIDIM_VERSION
gem 'decidim-initiatives', DECIDIM_VERSION
gem 'decidim-apiauth', github: 'mainio/decidim-module-apiauth'
gem 'omniauth_openid_connect', '0.6.1'

gem 'dotenv-rails', require: 'dotenv/rails-now'

gem 'bootsnap', '1.13.0'

gem 'puma', '5.6.5'
gem 'uglifier', '~> 4.1'

gem 'faker', '~> 2.17'

gem 'devise-i18n'

gem 'redis', '4.7.1'
gem 'hiredis', '0.6.3'
gem 'sidekiq', '6.5.7'

gem 'whenever', require: false

group :development, :test do
gem 'byebug', '11.1.3'
gem 'decidim-dev', DECIDIM_VERSION
end

group :development do
gem 'letter_opener_web', '~> 1.3'
gem 'listen', '~> 3.1'
gem 'rails-erd'
gem 'spring', '~> 2.0'
gem 'spring-watcher-listen', '~> 2.0'
gem 'web-console', '~> 3.5'
end

group :production do
gem 'aws-sdk-s3', require: false
end
Loading

0 comments on commit e325292

Please sign in to comment.