Skip to content

Commit

Permalink
added github actions flow
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegPhenomenon committed Jul 25, 2023
1 parent 96d0a95 commit edf3c6d
Showing 1 changed file with 91 additions and 0 deletions.
91 changes: 91 additions & 0 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Github Testing
on: [push]

jobs:
bundle_audit:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.0
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: Bundle Audit Check
run: bundle exec bundle-audit check --update

brakeman:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.0
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 Brakeman
run: bundle exec brakeman --quiet --skip-libs --exit-on-warn --ignore-config=.brakeman-ignore
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.sample 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 rspec spec
- name: Dependabot
if: ${{ github.event.label.name == 'dependencies' }}
run: bundle exec rails assets:precompile

0 comments on commit edf3c6d

Please sign in to comment.