Skip to content

Commit

Permalink
Deprecates Travis CI and uses CircleCI for continuous integration
Browse files Browse the repository at this point in the history
  • Loading branch information
jrgriffiniii committed May 13, 2019
1 parent 446dc6d commit 2e3818f
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 51 deletions.
77 changes: 77 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
version: 2
jobs:
build:

# Primary command image where all commands run
docker:
- image: circleci/ruby:2.4.5-node-browsers
environment:
RAILS_VERSION: "5.1.2"
RAILS_ENV: test
COVERAGE: true

working_directory: ~/requests

steps:
- checkout

# Set timezone to EST/EDT
- run:
name: Set Timezone to EST/EDT
command: echo 'America/New_York' = /etc/timezone

- run:
name: Install system packages
command: |
sudo apt update -y
sudo apt install -y postgresql-client phantomjs
# Install the Gem dependencies
- restore_cache:
keys:
- requests-{{ checksum "Gemfile.lock" }}
- requests-

- run:
name: Install the Gem dependencies
command: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs 4 --retry 3

- save_cache:
key: requests-{{ checksum "Gemfile.lock" }}
paths:
- ./vendor/bundle

# Generate the Rails Engine
- restore_cache:
name: Restore test app from cache
keys: v1-internal-test-app-{{ checksum "requests.gemspec" }}-{{ checksum "spec/test_app_templates/lib/generators/test_app_generator.rb" }}

- run:
name: Generate the Rails engine
command: |
bundle exec rake engine_cart:generate
- save_cache:
name: Save test app cache
key: v1-internal-test-app-{{ checksum "requests.gemspec" }}-{{ checksum "spec/test_app_templates/lib/generators/test_app_generator.rb" }}
paths: ./.internal_test_app

# Install additional Gem dependencies (required by the test app.)
- restore_cache:
keys:
- requests-{{ checksum "Gemfile.lock" }}
- requests-

- run:
name: Install additional Gem dependencies (required by the test app.)
command: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs 4 --retry 3

- save_cache:
key: requests-{{ checksum "Gemfile.lock" }}
paths:
- ./vendor/bundle

- run:
name: Run Rubocop and the RSpec test suites
command: bundle exec rake
44 changes: 0 additions & 44 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PUL Requests Engine

[![Build Status](https://travis-ci.org/pulibrary/requests.svg?branch=master)](https://travis-ci.org/pulibrary/requests)
[![CircleCI](https://circleci.com/gh/pulibrary/requests.svg?style=svg)](https://circleci.com/gh/pulibrary/requests)

## Dependencies

Expand Down
4 changes: 2 additions & 2 deletions spec/models/requests/recall_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@
expect(subject.errors.size).to eq(0)
end

it 'Should construct a expiration date for the recall request', unless: in_travis? do
it 'Should construct a expiration date for the recall request' do
stub_request(:put, @stub_url).
with(headers: { 'X-Accept' => 'application/xml' }).
to_return(status: 201, body: responses[:success], headers: {})
expect(subject.request_payload(submission.items.first)).to include("<last-interest-date>#{subject.recall_expiration_date}</last-interest-date>")
end

it 'should have an expiry date 60 days from today formatted as yyyy-mm-dd', unless: in_travis? do
it 'should have an expiry date 60 days from today formatted as yyyy-mm-dd' do
stub_request(:put, @stub_url).
with(headers: { 'X-Accept' => 'application/xml' }).
to_return(status: 201, body: responses[:success], headers: {})
Expand Down
4 changes: 0 additions & 4 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,6 @@ def wait_for_bd
end
end

def in_travis?
!ENV['TRAVIS'].nil? && ENV['TRAVIS'] == 'true'
end

def fixture(file)
File.open(File.join(File.dirname(__FILE__), 'fixtures', file), 'rb')
end

0 comments on commit 2e3818f

Please sign in to comment.