Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added github actions flow #4

Merged
merged 7 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/brakeman-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Brakeman Scan
on:
pull_request:
schedule:
- cron: "0 0 * * *"

jobs:
base:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.0
bundler-cache: true
- name: Install brakeman
run: gem install brakeman
- name: Static code analyses for security
run: brakeman
25 changes: 25 additions & 0 deletions .github/workflows/bundle-audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Bundle Audit
on:
pull_request:
schedule:
- cron: "0 0 * * *"
jobs:
base:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.0
bundler-cache: true
- name: Install bundler-audit
run: gem install bundler-audit
- name: Check dependencies with known vulnerabilities
run: bundle-audit --update
- name: Check javascript dependencies
run: yarn audit
59 changes: 59 additions & 0 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Github Testing
on: [push]

jobs:
test:
services:
postgres:
image: postgres:15
ports: ["5432:5432"]
env:
POSTGRES_PASSWORD: password
POSTGRES_USERNAME: postgres
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
ruby: [ '3.2.0' ]
runs-on: ${{ matrix.os }}
continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }}

steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically

- name: config bundler
run: |
bundle config set without 'development staging production'
bundle config set deployment '[secure]'
bundle env
head -n1 $(which bundle)

- name: Run Tests
env:
PG_DATABASE: postgres
PG_HOST: localhost
PG_USER: postgres
PG_PASSWORD: password
PG_PORT: ${{ job.services.postgres.ports[5432] }}
RAILS_ENV: test
COVERAGE: true
DISABLE_SPRING: 1
run: |
cp config/application.yml.example config/application.yml
cp config/database_ci.yml config/database.yml
bundle exec rake db:create
bundle exec rake db:migrate
bundle exec rake db:schema:load
bundle exec rake db:seed
bundle exec rails assets:precompile
bundle exec rspec spec

- name: Dependabot
if: ${{ github.event.label.name == 'dependencies' }}
run: bundle exec rails assets:precompile
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
AllCops:
Exclude:
- 'spec/**/*'
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ gem 'omniauth-tara', github: 'internetee/omniauth-tara'
gem 'pg', '~> 1.1'
gem 'propshaft'
gem 'puma', '~> 5.0'
gem 'rails', '~> 7.0.4', '>= 7.0.4.3'
gem 'rails', '~> 7.0.5', '>= 7.0.5.1'
gem 'redis', '~> 4.0'
gem 'redis-namespace'
gem 'sidekiq', '<7'
Expand All @@ -47,6 +47,8 @@ group :development, :test do
gem 'rspec-rails'
gem 'vcr'
gem 'webmock'
gem 'brakeman', require: false
gem 'bundle-audit', require: false
end

group :development do
Expand Down
Loading
Loading