Skip to content

fix: Gemfile & Gemfile.lock to reduce vulnerabilities #172

fix: Gemfile & Gemfile.lock to reduce vulnerabilities

fix: Gemfile & Gemfile.lock to reduce vulnerabilities #172

Workflow file for this run

name: Rails
on: [push]
jobs:
test:
runs-on: ubuntu-latest
services:
db:
image: postgres:15
ports: ['5432:5432']
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis
ports: ['6379:6379']
steps:
- uses: actions/checkout@v1
- uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Set up Ruby 3.1
uses: actions/setup-ruby@v1
with:
ruby-version: 3.1.x
- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: 19
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get -yqq install libpq-dev chromium-chromedriver
gem install bundler
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
yarn install
- name: Prepare Database
env:
PGHOST: 127.0.0.1
PGUSER: postgres
PGPASSWORD: postgres
RAILS_ENV: test
run: |
bundle exec rails db:test:prepare
- name: Run ruby tests
env:
PGHOST: 127.0.0.1
PGUSER: postgres
PGPASSWORD: postgres
RAILS_ENV: test
run: |
bundle exec rails test
- name: Run system test cases
env:
PGHOST: 127.0.0.1
PGUSER: postgres
PGPASSWORD: postgres
RAILS_ENV: test
run: |
bundle exec rails test:system
- name: Run benchmarks
env:
PGHOST: 127.0.0.1
PGUSER: postgres
PGPASSWORD: postgres
RAILS_ENV: test
run: |
bin/benchmark