Skip to content

Merge pull request #96 from wearefuturegov/BSP-76-ensure-order-of-qua… #379

Merge pull request #96 from wearefuturegov/BSP-76-ensure-order-of-qua…

Merge pull request #96 from wearefuturegov/BSP-76-ensure-order-of-qua… #379

Workflow file for this run

name: Run tests
on: [push]
jobs:
run-tests:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:13.7-alpine
ports:
- 5432:5432
env:
POSTGRES_USER: tell-us-who-you-employ
POSTGRES_PASSWORD: password
POSTGRES_DB: tell-us-who-you-employ_test
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Ruby and install gems
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Install required Node.js version
uses: actions/setup-node@v2
with:
node-version: 20.9.0
- name: Install dependent libraries
run: sudo apt-get install libpq-dev
- name: Yarn install
run: yarn --frozen-lockfile
- name: Setup database
env:
RAILS_ENV: test
run: |
bundle exec rails db:drop
bundle exec rails db:create
bundle exec rails db:migrate
- name: Compile assets
env:
RAILS_ENV: test
run: bundle exec rails assets:precompile
- name: Run tests
env:
RAILS_ENV: test
run: bundle exec rspec
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v2