Skip to content

Build & Test

Build & Test #5763

Workflow file for this run

name: Build & Test
on: [push]
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Configure sysctl limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- uses: actions/checkout@v2
- name: Start containers
run: docker-compose up -d
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- uses: actions/setup-node@v2
with:
node-version: '16.13.0'
check-latest: true
cache: yarn
- run: yarn
- name: Setup DB, Run tests
env:
RAILS_ENV: test
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
run: |
bundle exec rake db:drop db:create db:migrate RAILS_ENV=test
bundle exec rspec
- name: Containers logs
if: failure()
run: docker-compose logs
- name: Stop containers
if: always()
run: docker-compose down