mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 09:41:40 -05:00
57 lines
1.5 KiB
YAML
57 lines
1.5 KiB
YAML
name: CI
|
|
on: [pull_request]
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
services:
|
|
postgres:
|
|
image: postgres:12
|
|
ports:
|
|
- 5432:5432
|
|
env:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
|
|
- name: Setup Ruby and install gems
|
|
uses: ruby/setup-ruby@v1
|
|
with:
|
|
bundler-cache: true
|
|
|
|
- name: Install dependent libraries
|
|
run: sudo apt-get install libpq-dev
|
|
|
|
- name: Bundle install
|
|
run: |
|
|
gem install bundler
|
|
bundle install --jobs 4 --retry 3
|
|
|
|
- name: Install daisyui
|
|
run: npm i daisyui
|
|
|
|
- name: Compile assets
|
|
run: bundle exec rake assets:precompile
|
|
|
|
- name: Setup Database
|
|
run: |
|
|
cp config/database.yml.github-actions config/database.yml
|
|
bundle exec rake db:create
|
|
bundle exec rake db:schema:load
|
|
env:
|
|
RAILS_ENV: test
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
|
|
- name: Run RSpec
|
|
run: COVERAGE=true bundle exec rspec --require rails_helper
|
|
env:
|
|
RAILS_ENV: test
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
|
|
- name: Simplecov Report
|
|
uses: aki77/simplecov-report-action@v1
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|