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/.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 8752c8dea..5264b3ac2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 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/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 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