Skip to content

Commit

Permalink
kthxbye travis, hai github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
codez committed Nov 10, 2021
1 parent 4e0bb7e commit bb20492
Show file tree
Hide file tree
Showing 2 changed files with 112 additions and 1 deletion.
111 changes: 111 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@

name: Build

on:
push:
pull_request:
branches: [ $default-branch ]

env:
RAAR_DB_ADAPTER: postgresql
RAAR_DB_HOST: localhost
RAAR_DB_NAME: raar_test
RAAR_DB_USERNAME: postgres
RAAR_DB_PASSWORD: postgres
AIRTIME_DB_ADAPTER: postgresql
AIRTIME_DB_HOST: localhost
AIRTIME_DB_NAME: airtime_test
AIRTIME_DB_USERNAME: postgres
AIRTIME_DB_PASSWORD: postgres
PARALLEL_WORKERS: 1

jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['2.5', '2.7', '3.0']

services:
db:
image: postgres:11
env:
POSTGRES_USER: postgres
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
ports: ['5432:5432']
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Prepare
env:
PGPASSWORD: postgres
run: |
sudo apt-get update
sudo apt-get install -y ffmpeg
psql -c 'create database raar_test;' -U $RAAR_DB_USERNAME -h $RAAR_DB_HOST
psql -c 'create database airtime_test;' -U $RAAR_DB_USERNAME -h $RAAR_DB_HOST
- name: Run tests
run: bundle exec rails test

lint:
name: Lint
runs-on: ubuntu-latest

services:
db:
image: postgres:11
env:
POSTGRES_USER: postgres
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
ports: ['5432:5432']
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run rubocop
run: bundle exec rubocop

coverage:
name: Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Prepare
env:
PGPASSWORD: postgres
run: |
sudo apt-get update
sudo apt-get install -y ffmpeg
psql -c 'create database raar_test;' -U $RAAR_DB_USERNAME -h $RAAR_DB_HOST
psql -c 'create database airtime_test;' -U $RAAR_DB_USERNAME -h $RAAR_DB_HOST
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# RAAR Radio Archive

[![Build Status](https://app.travis-ci.com/radiorabe/raar.svg?branch=master)](https://app.travis-ci.com/github/radiorabe/raar)
[![Build Status](https://github.com/radiorabe/raar/actions/workflows/build.yml/badge.svg)](https://github.com/radiorabe/raar/actions/workflows/build.yml)
[![Code Climate](https://codeclimate.com/github/radiorabe/raar/badges/gpa.svg)](https://codeclimate.com/github/radiorabe/raar)
[![Coverage Status](https://coveralls.io/repos/github/radiorabe/raar/badge.svg?branch=master)](https://coveralls.io/github/radiorabe/raar?branch=master)

Expand Down

0 comments on commit bb20492

Please sign in to comment.