Skip to content
This repository was archived by the owner on Dec 22, 2022. It is now read-only.

Use github workflows to run CI #2125

Merged
merged 3 commits into from
Dec 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI
on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Build the docker-compose stack
run: docker-compose -f docker-compose.lightweight.yml up -d

- name: install xmllint
run: sudo apt-get install libxml2-utils

- name: Set up Ruby 2.6
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6.6

- name: Cache Ruby gems
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gem-

- name: Bundle gems
run: |
bundle config path vendor/bundle
bundle config set without 'production development'
bundle install --jobs 4 --retry 3

- name: Lint with RuboCop
run: bundle exec rubocop --parallel

- name: Run Tests
env:
RAILS_ENV: test
run: |
bundle exec rake db:create
bundle exec rake db:migrate
Copy link
Contributor

@murny murny Dec 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small tip, I think rails db:schema:load is a bit more performant than doing migrations (Will use the db/schema.rb to provision DB instead of running all the migrations). But that's totally up to you 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 You've definitely warned me about this before and I had hoped to fix it. Right now there is some seeding that tests depend on that is set up by migrations. It's a pain to deal with and I've learned my lesson.
#1932

bundle exec rake spec
32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ and releases in Discovery project adheres to [Semantic Versioning](http://semver

## [Unreleased]

### Changed
- use github workflows to run CI [#2121](https://github.com/ualbertalib/discovery/issues/2121)
- lightweight docker includes mysql by default [PR#2125](https://github.com/ualbertalib/discovery/pull/2125)
- remove travis CI [#2121](https://github.com/ualbertalib/discovery/issues/2121)

## [3.5.5]

### Fixed
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Discovery Interface for University of Alberta Library
[![Build Status](https://travis-ci.org/ualbertalib/discovery.svg?branch=master)](https://travis-ci.org/ualbertalib/discovery)

This is the code base for the University of Alberta Library's
discovery platform. Based on [Project Blacklight](projectblacklight.org).
Expand Down
5 changes: 0 additions & 5 deletions config/.travis.database.yml

This file was deleted.

21 changes: 10 additions & 11 deletions docker-compose.lightweight.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,20 @@
version: '3'

volumes:
# mysql:
# driver: local
mysql:
driver: local
solr:
driver: local

services:
# Need mysql? Uncomment mysql settings below and respective volume above
# mysql:
# image: mysql:5.7
# environment:
# MYSQL_ROOT_PASSWORD: mysecretpassword
# volumes:
# - mysql:/var/lib/mysql
# ports:
# - "3306:3306"
mysql:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: mysecretpassword
volumes:
- mysql:/var/lib/mysql
ports:
- "3306:3306"

solr:
image: ualbertalib/blacklight_solr_conf
Expand Down
2 changes: 1 addition & 1 deletion spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
# Only want VCR to intercept requests to external URLs.
config.ignore_localhost = true

# ignore travis trying to get webdrivers
# ignore CI trying to get webdrivers
driver_hosts = Webdrivers::Common.subclasses.map { |driver| URI(driver.base_url).host }
config.ignore_hosts(*driver_hosts)
end
Expand Down