Skip to content

Commit

Permalink
Merge pull request #294 from jhsu802701/github-workflows
Browse files Browse the repository at this point in the history
Added GitHub Workflows
  • Loading branch information
pcantrell authored Jun 9, 2024
2 parents 9863785 + 5186784 commit b081997
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 59 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: CI

on: [push, pull_request ]

jobs:
verify:
runs-on: ubuntu-latest

defaults:
run:
working-directory: ./src

services:
postgres:
image: postgres:latest
ports: ["5432:5432"]
env:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: sessionizer_test
POSTGRES_USER: vagrant
POSTGRES_PASSWORD: vagrant

steps:
- uses: actions/checkout@v4

- name: Install Linux libraries
run: sudo apt-get install -y libpq-dev

- name: Set up Ruby and run bundle install
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.7
bundler-cache: true
working-directory: ./src

- name: Show Ruby version
run: ruby -v

- name: Prepare database and run tests
env:
CI: github
RAILS_ENV: test
POSTGRES_DB: sessionizer_test
POSTGRES_USER: vagrant
POSTGRES_PASSWORD: vagrant
run: |
bundle exec rake db:create db:migrate db:test:prepare
bundle exec rails spec
27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

Sessionizer is a tool for managing session registration for unconferences. It was written for [Minnebar](http://minnestar.org/minnebar/), an unconference in Minnesota and one of the largest BarCamps in the world.

[![Build Status](http://img.shields.io/travis/minnestar/sessionizer.svg)](https://travis-ci.org/minnestar/sessionizer) [![Coveralls](http://img.shields.io/coveralls/minnestar/sessionizer.svg)](https://coveralls.io/r/minnestar/sessionizer) [![Scrutinizer](http://img.shields.io/scrutinizer/g/minnestar/sessionizer.svg)](https://scrutinizer-ci.com/g/minnestar/sessionizer/)

[![Scrutinizer](http://img.shields.io/scrutinizer/g/minnestar/sessionizer.svg)](https://scrutinizer-ci.com/g/minnestar/sessionizer/)

## Features

Expand Down
3 changes: 1 addition & 2 deletions src/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ group :development, :test do
gem 'rails-controller-testing'
gem 'capybara'
gem 'pry'
gem 'coveralls', require: false
gem "simplecov", "~> 0.22.0"
end

group :test do
Expand All @@ -61,4 +61,3 @@ end

#https://devcenter.heroku.com/articles/rails-4-asset-pipeline
gem 'rails_12factor', group: :production

23 changes: 6 additions & 17 deletions src/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,6 @@ GEM
xpath (~> 3.2)
coderay (1.1.3)
concurrent-ruby (1.2.0)
coveralls (0.8.23)
json (>= 1.8, < 3)
simplecov (~> 0.16.1)
term-ansicolor (~> 1.3)
thor (>= 0.19.4, < 2.0)
tins (~> 1.6)
crass (1.0.6)
database_cleaner (2.0.1)
database_cleaner-active_record (~> 2.0.0)
Expand Down Expand Up @@ -116,7 +110,6 @@ GEM
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (2.6.3)
kgio (2.11.4)
loofah (2.19.1)
crass (~> 1.0.2)
Expand Down Expand Up @@ -241,11 +234,12 @@ GEM
websocket (~> 1.0)
shoulda-matchers (5.3.0)
activesupport (>= 5.2.0)
simplecov (0.16.1)
simplecov (0.22.0)
docile (~> 1.1)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
spring (4.1.1)
sprockets (3.7.2)
concurrent-ruby (~> 1.0)
Expand All @@ -255,16 +249,11 @@ GEM
activesupport (>= 5.2)
sprockets (>= 3.0.0)
strscan (3.1.0)
sync (0.5.0)
temple (0.10.0)
term-ansicolor (1.7.1)
tins (~> 1.0)
thor (1.2.1)
thread_safe (0.3.6)
tilt (2.1.0)
timeout (0.3.2)
tins (1.32.1)
sync
turbolinks (5.2.1)
turbolinks-source (~> 5.2)
turbolinks-source (5.2.0)
Expand All @@ -291,7 +280,6 @@ DEPENDENCIES
bcrypt-ruby (~> 3.1)
cancancan
capybara
coveralls
database_cleaner
factory_bot_rails
fancybox2-rails
Expand All @@ -315,6 +303,7 @@ DEPENDENCIES
sass-rails (~> 5.0)
selenium-webdriver (~> 4.9)
shoulda-matchers
simplecov (~> 0.22.0)
spring
turbolinks
uglifier (>= 1.3.0)
Expand Down
3 changes: 3 additions & 0 deletions src/config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ default: &default
encoding: unicode
# For details on connection pooling, see rails configuration guide
# http://guides.rubyonrails.org/configuring.html#database-pooling

# Database does not work in GitHub Workflows if host parameter is not specified
host: localhost
pool: 5
username: vagrant
password:
Expand Down
4 changes: 0 additions & 4 deletions src/config/database.yml.travis

This file was deleted.

4 changes: 2 additions & 2 deletions src/spec/features/interest_gathering_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
visit root_path
end

scenario "As a guest, I want to express my interest", js: true do
scenario "As a guest, I want to express my interest", js: true, unless: ENV['CI'] do

click_link "A neat talk", match: :first
page.find("#attend").click
Expand All @@ -25,7 +25,7 @@
end


scenario "As a signed in user I want to express my interest", js: true do
scenario "As a signed in user I want to express my interest", js: true, unless: ENV['CI'] do
sign_in_user user

click_link "A neat talk", match: :first
Expand Down
6 changes: 1 addition & 5 deletions src/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,14 @@
ENV["RAILS_ENV"] ||= 'test'

require 'simplecov'
if ENV['CI']
require 'coveralls'
SimpleCov.formatter = Coveralls::SimpleCov::Formatter
end
SimpleCov.start :rails do
add_filter "/spec/"
end

require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'

Capybara.default_max_wait_time = ENV['TRAVIS'] ? 30 : 15
Capybara.default_max_wait_time = ENV['CI'] ? 90 : 15
require 'capybara/rspec'
require 'capybara/rails'
require 'authlogic/test_case'
Expand Down

0 comments on commit b081997

Please sign in to comment.