-
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 #45 from atomicjolt/ds/multi-tenancy
Add models and helpers for multi tenancy
- Loading branch information
Showing
44 changed files
with
1,508 additions
and
192 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,21 @@ | ||
name: brakeman | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: | ||
- '*' | ||
|
||
jobs: | ||
brakeman: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Install Ruby and gems | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
- name: Security audit application code | ||
run: bundle exec brakeman -q -w2 |
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,42 @@ | ||
on: [pull_request] | ||
|
||
name: Pronto | ||
|
||
jobs: | ||
linters: | ||
name: Linters | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
ruby-version: [3.3] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- run: | | ||
git fetch --no-tags --prune --depth=10 origin +refs/heads/*:refs/remotes/origin/* | ||
- name: Setup Ruby | ||
uses: ruby/setup-ruby@v1 | ||
|
||
- name: Ruby gem cache | ||
uses: actions/cache@v1 | ||
with: | ||
path: vendor/bundle | ||
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-gems- | ||
- name: Setup pronto | ||
run: gem install pronto pronto-rubocop | ||
|
||
- name: Install gems | ||
run: | | ||
bundle config path vendor/bundle | ||
bundle install --jobs 4 --retry 3 | ||
- name: Run Pronto | ||
run: bundle exec pronto run -f github_status github_pr -c origin/${{ github.base_ref }} | ||
env: | ||
PRONTO_PULL_REQUEST_ID: ${{ github.event.pull_request.number }} | ||
PRONTO_GITHUB_ACCESS_TOKEN: "${{ github.token }}" |
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,66 @@ | ||
name: rspec | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
rspec-test: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
ruby-version: [3.3] | ||
|
||
# Service containers to run with `container-job` | ||
services: | ||
# Label used to access the service container | ||
postgres: | ||
# Docker Hub image | ||
image: postgres:13.8 | ||
# Provide the password for postgres | ||
env: | ||
POSTGRES_DB: postgres_test | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
ports: ["5432:5432"] | ||
# Set health checks to wait until postgres has started | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Ruby ${{ matrix.ruby-version }} | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby-version }} | ||
bundler-cache: true | ||
|
||
- name: Install dependencies | ||
env: | ||
RAILS_ENV: test | ||
RAILS_GROUPS: build | ||
run: | | ||
bundle install | ||
- name: Copy database config yml | ||
run: cp test/dummy/config/ci.database.yml test/dummy/config/database.yml | ||
|
||
- name: Create db | ||
env: | ||
RAILS_ENV: test | ||
run: bin/rails db:create | ||
|
||
- name: Run migrations | ||
env: | ||
RAILS_ENV: test | ||
run: bin/rails db:migrate | ||
|
||
- name: Run tests | ||
env: | ||
RAILS_ENV: test | ||
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 @@ | ||
ruby 3.3.5 |
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
Oops, something went wrong.