43 lines
1.0 KiB
YAML
43 lines
1.0 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [develop, master]
|
|
pull_request:
|
|
branches: [develop, master]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
services:
|
|
postgres:
|
|
image: postgres:14.5
|
|
ports: ["5432:5432"]
|
|
env:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
POSTGRES_DB: timeoverflow_test
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Set up Ruby
|
|
uses: ruby/setup-ruby@v1
|
|
with:
|
|
bundler-cache: true
|
|
- name: Install ImageMagick
|
|
uses: mfinelli/setup-imagemagick@v6
|
|
with:
|
|
cache: true
|
|
- name: Run tests
|
|
env:
|
|
RAILS_ENV: test
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
run: |
|
|
bundle exec rails db:setup
|
|
bundle exec rspec
|
|
- name: Publish code coverage
|
|
uses: qltysh/qlty-action/coverage@v1
|
|
with:
|
|
token: ${{ secrets.QLTY_COVERAGE_TOKEN }}
|
|
files: coverage/.resultset.json
|