Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
manno committed Oct 19, 2021
2 parents c536019 + 534c9f2 commit a769d02
Show file tree
Hide file tree
Showing 106 changed files with 1,963 additions and 431 deletions.
1 change: 1 addition & 0 deletions .env.development
Expand Up @@ -16,6 +16,7 @@ FROM_EMAIL=frab@localhost
#SMTP_PASSWORD=toor
#SMTP_AUTHENTICATION=1
#SMTP_NOTLS=1
#OVERRIDE_PROFILE_PHOTO=1
#GOOGLE_CLIENT_ID=
#GOOGLE_CLIENT_SECRET=
#NAME_FOR_LDAP=
Expand Down
4 changes: 2 additions & 2 deletions .env.test
Expand Up @@ -8,8 +8,8 @@ LDAP_HOST=ldap.forumsys.com
LDAP_PORT=389
LDAP_METHOD=plain
LDAP_BASE_DN=dc=example,dc=com
LDAP_UID=uid
LDAP_FILTER=
LDAP_UID=
LDAP_FILTER=(|(uid=%{username})(mail=%{username}))
LDAP_BIND_DN=
LDAP_BIND_PASSWORD=
LDAP_DISABLE_VERIFY_CERT=
20 changes: 20 additions & 0 deletions .github/database.yml
@@ -0,0 +1,20 @@
sqlite: &sqlite
adapter: sqlite3
database: db/test.sqlite3

mysql: &mysql
adapter: mysql2
url: MYSQL

postgresql: &postgresql
adapter: postgresql
url: POSTGRES
min_messages: ERROR

defaults: &defaults
pool: 5
timeout: 5000
<<: *<%= ENV['DB'] || "sqlite" %>

test:
<<: *defaults
31 changes: 31 additions & 0 deletions .github/dependabot.yml
@@ -0,0 +1,31 @@
version: 2
updates:
- package-ecosystem: bundler
directory: "/"
schedule:
interval: monthly
open-pull-requests-limit: 10
ignore:
- dependency-name: capistrano3-puma
versions:
- 5.0.2
- dependency-name: rails-controller-testing
versions:
- 1.0.5
- dependency-name: factory_bot_rails
versions:
- 6.1.0
- dependency-name: bootsnap
versions:
- 1.5.1
- 1.6.0
- 1.7.1
- dependency-name: repost
versions:
- 0.3.6
- dependency-name: capistrano
versions:
- 3.15.0
- dependency-name: haml
versions:
- 5.2.1
4 changes: 4 additions & 0 deletions .github/release-drafter.yml
@@ -0,0 +1,4 @@
template: |
## What’s Changed
$CHANGES
89 changes: 89 additions & 0 deletions .github/workflows/ci.yaml
@@ -0,0 +1,89 @@
name: frab

on:
pull_request:
schedule:
- cron: '0 0 * * *'

jobs:
tests:
runs-on: ubuntu-latest

env:
RAILS_ENV: test

strategy:
matrix:
ruby_version:
- 2.6
- 2.7
db:
- mysql
- postgresql
- sqlite

services:
postgres:
image: postgres:11
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
POSTGRES_PASSWORD: root

mysql:
image: mariadb:10.3
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
env:
MYSQL_ROOT_PASSWORD: root

steps:
- uses: actions/checkout@v2

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{matrix.ruby_version}}
bundler-cache: true

- name: Prepare Postgresql
run: |
bundle exec rails db:create
sed 's#url: POSTGRES#url: '$DATABASE_URL'#' .github/database.yml > config/database.yml
env:
DATABASE_URL: postgres://postgres:root@127.0.0.1:${{ job.services.postgres.ports[5432] }}/frab_test
if: matrix.db == 'postgresql'

- name: Prepare MySQL
run: |
bundle exec rails db:create
echo $DATABASE_URL
sed 's#url: MYSQL#url: '$DATABASE_URL'#' .github/database.yml > config/database.yml
env:
DATABASE_URL: mysql2://root:root@127.0.0.1:${{ job.services.mysql.ports[3306] }}/frab_test
if: matrix.db == 'mysql'

- name: Prepare SQLite
run: |
cp .github/database.yml config/database.yml
bundle exec rails db:create
if: matrix.db == 'sqlite'

- name: Run tests
run: |
sed -i 's/config.eager_load = .*/config.eager_load = true/' config/environments/test.rb
bundle exec rails db:schema:load --trace
mv db/schema.rb db/schema.rb.original
bundle exec rails db:rollback STEP=9
bundle exec rails db:migrate
sh -c "[ '$DB' != 'sqlite' ] || diff db/schema.rb db/schema.rb.original "
bundle exec rails db:test:prepare
bundle exec rails test
env:
DB: ${{ matrix.db }}
16 changes: 16 additions & 0 deletions .github/workflows/release-drafter.yml
@@ -0,0 +1,16 @@
name: Release Drafter

on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- master

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 3 additions & 2 deletions .travis.yml
@@ -1,16 +1,17 @@
language: ruby
dist: trusty
cache: bundler
rvm:
- 2.4.4
- 2.6.3
- 2.7.0
- 2.7
env:
- DB=mysql
- DB=postgresql
- DB=sqlite
before_install:
- gem install -N bundler
bundler_args: --without capistrano doc production --jobs 2

before_script:
- cp config/database.yml.travis config/database.yml
- sed -i 's/config.eager_load = .*/config.eager_load = true/' config/environments/test.rb
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
@@ -1,4 +1,4 @@
FROM ruby:latest
FROM ruby:2.7

RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs file imagemagick git && \
Expand Down
21 changes: 13 additions & 8 deletions Gemfile
Expand Up @@ -30,8 +30,8 @@ gem 'sqlite3', group: :sqlite3
gem 'puma'

# Capistrano for deployment
group :capistrano do
gem 'capistrano', '3.8.2', require: false
group :capistrano, optional: true do
gem 'capistrano', '3.16.0', require: false
gem 'capistrano-rails', require: false
gem 'capistrano-bundler', require: false
gem 'capistrano-rvm', require: false
Expand All @@ -49,7 +49,6 @@ gem 'jbuilder'

gem 'activemodel-serializers-xml'
gem 'activeresource'
gem 'acts_as_commentable'
gem 'bcrypt'
gem 'bootsnap'
gem 'cocoon'
Expand All @@ -58,20 +57,21 @@ gem 'dotenv-rails'
gem 'github-markdown'
gem 'haml'
gem 'http_accept_language'
gem 'invisible_captcha'
gem 'localized_language_select', github: 'frab/localized_language_select', branch: 'master'
gem 'nokogiri'
gem 'omniauth-google-oauth2'
gem 'gitlab_omniauth-ldap'
gem 'omniauth_openid_connect'
gem 'omniauth-rails_csrf_protection'
gem 'paperclip'
gem 'kt-paperclip'
gem 'paper_trail'
gem 'prawn', '< 1.0'
gem 'prawn_rails'
gem 'pundit'
gem 'ransack'
gem 'redcarpet'
gem 'repost', '~> 0.3.0'
gem 'repost', '~> 0.3.7'
gem 'ri_cal'
gem 'roust', github: 'frab/roust', branch: 'disallowed-ticket-1-fix'
gem 'rqrcode'
Expand All @@ -86,6 +86,11 @@ group :production do
gem 'exception_notification'
end

group :productionplus, optional: true do
gem 'activerecord-session_store'
gem 'dalli'
end

group :development, :test do
gem 'listen'
gem 'bullet'
Expand All @@ -97,14 +102,14 @@ group :development, :test do
end

group :test do
gem 'database_cleaner'
gem 'factory_bot_rails', '~> 4.0'
gem 'factory_bot_rails', '~> 6.2'
gem 'database_cleaner-active_record'
gem 'rails-controller-testing'
gem 'minitest-rails-capybara'
gem 'poltergeist'
end

group :doc do
group :doc, optional: true do
# gem 'rails-erd' # graph
# gem 'ruby-graphviz', require: 'graphviz' # Optional: only required for graphing
end

0 comments on commit a769d02

Please sign in to comment.