Skip to content

Instantly share code, notes, and snippets.

@gilesvangruisen
Created April 5, 2020 15:58
Show Gist options
  • Save gilesvangruisen/664c25c07b5d8416b01c9a7670c5eb32 to your computer and use it in GitHub Desktop.
Save gilesvangruisen/664c25c07b5d8416b01c9a7670c5eb32 to your computer and use it in GitHub Desktop.
Ruby/Rails GitHub Actions CI
name: rspec
on:
pull_request:
branches:
- "master"
push:
branches:
- "master"
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:11.5
ports: ["5432:5432"]
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v1
- name: Set up Ruby 2.6
uses: ruby/[email protected]
with:
ruby-version: 2.6.4
- name: Install PostgreSQL 11 client
run: |
sudo apt-get -yqq install libpq-dev
- uses: actions/cache@v1
with:
path: ./skipper/vendor/bundle
key: ${{ runner.os }}-bundle-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-bundle-
- name: Build App
working-directory: ./skipper
env:
PGHOST: localhost
PGUSER: postgres
RAILS_ENV: test
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
bin/rails db:setup
yarn
- name: Run Tests
working-directory: ./skipper
env:
PGHOST: localhost
PGUSER: postgres
RAILS_ENV: test
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
run: |
bundle exec rspec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment