From 4dbe480d5c54253f741d072d28989ad7a6c26320 Mon Sep 17 00:00:00 2001 From: Tricia Jenkins Date: Tue, 22 Dec 2020 14:20:13 -0700 Subject: [PATCH 1/3] use github workflows to run CI With travis-ci transitioning to a limited credit system after Dec 31st and currently taking hours for jobs to go from queued to completion, I think we'll need to migrate all our CI to github actions --- .github/workflows/push.yml | 45 ++++++++++++++++++++++++++++++++++++++ CHANGELOG.md | 3 +++ 2 files changed, 48 insertions(+) create mode 100644 .github/workflows/push.yml diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml new file mode 100644 index 000000000..dc18dc906 --- /dev/null +++ b/.github/workflows/push.yml @@ -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 + bundle exec rake spec diff --git a/CHANGELOG.md b/CHANGELOG.md index 8752c8dea..796bd583c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ 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) + ## [3.5.5] ### Fixed From 77159f3ec5259927385179fc3e7ea9868b857cf1 Mon Sep 17 00:00:00 2001 From: Tricia Jenkins Date: Tue, 22 Dec 2020 15:49:52 -0700 Subject: [PATCH 2/3] lightweight docker includes mysql by default now I use a custom docker-compose which includes this anyways. mysql is also necessary for github actions so making this the default. --- CHANGELOG.md | 1 + docker-compose.lightweight.yml | 21 ++++++++++----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 796bd583c..3f0a6e690 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and releases in Discovery project adheres to [Semantic Versioning](http://semver ### Changed - use github workflows to run CI [#2121](https://github.com/ualbertalib/discovery/issues/2121) +- lightweight docker includes mysql by default ## [3.5.5] diff --git a/docker-compose.lightweight.yml b/docker-compose.lightweight.yml index eb2e6be0e..1830fcaec 100644 --- a/docker-compose.lightweight.yml +++ b/docker-compose.lightweight.yml @@ -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 From f14851f05f65fa86ebf9cf130b73b19cf22f6dd3 Mon Sep 17 00:00:00 2001 From: Tricia Jenkins Date: Tue, 22 Dec 2020 16:10:23 -0700 Subject: [PATCH 3/3] remove travis CI --- .travis.yml | 32 -------------------------------- CHANGELOG.md | 3 ++- README.md | 1 - config/.travis.database.yml | 5 ----- spec/rails_helper.rb | 2 +- 5 files changed, 3 insertions(+), 40 deletions(-) delete mode 100644 .travis.yml delete mode 100644 config/.travis.database.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7706061f0..000000000 --- a/.travis.yml +++ /dev/null @@ -1,32 +0,0 @@ -language: ruby -addons: - chrome: stable - apt: - packages: - - libxml2-utils -rvm: - - 2.5 - - 2.6 -cache: bundler -bundler_args: --without development production --jobs=3 --retry=3 -services: - - mysql -before_script: - - bundle exec danger - - docker version - - docker-compose version - - - docker-compose -f docker-compose.lightweight.yml up -d - - - docker ps - - - "mysql -e 'create database discovery_test character set utf8;'" - - "cp ./config/.travis.database.yml ./config/database.yml" - - - bundle --version - - - RAILS_ENV=test bundle exec rake db:create - - RAILS_ENV=test bundle exec rake db:migrate -script: - - bundle exec rake spec - - bundle exec rubocop diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f0a6e690..5264b3ac2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,8 @@ and releases in Discovery project adheres to [Semantic Versioning](http://semver ### Changed - use github workflows to run CI [#2121](https://github.com/ualbertalib/discovery/issues/2121) -- lightweight docker includes mysql by default +- 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] diff --git a/README.md b/README.md index aa6852653..ede0473aa 100644 --- a/README.md +++ b/README.md @@ -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). diff --git a/config/.travis.database.yml b/config/.travis.database.yml deleted file mode 100644 index e76ef57f0..000000000 --- a/config/.travis.database.yml +++ /dev/null @@ -1,5 +0,0 @@ -test: - adapter: mysql2 - database: discovery_test - username: root - encoding: utf8 diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index d60edacad..441d872f0 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -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