diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..93093ba785 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,63 @@ +name: CI + +on: [push, pull_request] + +jobs: + RSpec: + runs-on: ubuntu-latest + strategy: + matrix: + ruby: + - '2.5.x' + - '2.6.x' + database: + - mysql + - postgresql + env: + DB: ${{ matrix.database }} + MYSQL_PASSWORD: root + PGHOST: 127.0.0.1 + PGUSER: postgres + RAILS_ENV: test + CC_TEST_REPORTER_ID: bca4349e32f97919210ac8a450b04904b90683fcdd57d65a22c0f5065482bc22 + services: + postgres: + image: postgres:10 + ports: ['5432:5432'] + options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + steps: + - uses: actions/checkout@v1 + - name: Set up Ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + - name: Install Postgres headers + if: matrix.database == 'postgresql' + run: | + sudo apt-get install -yqq libpq-dev + - name: Install MySQL headers + if: matrix.database == 'mysql' + run: | + sudo apt-get install -yqq libmysqlclient-dev + - name: Install bundle + timeout-minutes: 10 + run: | + gem install bundler + bundle install --jobs 4 --retry 3 + - name: Prepare database + run: | + bundle exec rake alchemy:spec:prepare + - name: Install code climate test reporter + run: | + curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter + chmod +x ./cc-test-reporter + ./cc-test-reporter before-build + - name: Test with RSpec + run: | + bundle exec rspec + ./cc-test-reporter after-build --exit-code $? + - uses: actions/upload-artifact@master + if: failure() + with: + name: Screenshots + path: spec/dummy/tmp/screenshots diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f335715e6d..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -language: ruby -dist: bionic -sudo: false -services: - - mysql -addons: - postgresql: "10" -cache: - bundler: true - directories: - - /home/travis/.webdrivers/ -rvm: - - 2.5.7 - - 2.6.5 -before_install: - - gem install bundler -before_script: - - bundle exec rake alchemy:spec:prepare -script: bundle exec rspec -after_success: bundle exec codeclimate-test-reporter -env: - - DB=mysql - - DB=postgresql -notifications: - slack: - secure: QzOFw1Ph69pzwWBFgtIVkOnjbcRxB9HPRQ+RYjK+2tg+fsbiTJ+wYgHcZL49tPYcLAls4kymkFWzWBF3PCAXJMfKgUCqXzdQ2FuJC/JoVRTLll4wDnZFPG33jsm5tVznmycZ3ma4+ZWfJQ+C+elEBOba6v1kG9eGIy6sH2cvXfE= diff --git a/Gemfile b/Gemfile index f321cef28a..b5351e62e6 100644 --- a/Gemfile +++ b/Gemfile @@ -15,9 +15,6 @@ gem 'sassc-rails' group :development, :test do gem 'simplecov', require: false gem 'bootsnap', require: false - if ENV['TRAVIS'] - gem 'codeclimate-test-reporter', '~> 1.0', require: false - end unless ENV['CI'] gem 'launchy' gem 'annotate' diff --git a/README.md b/README.md index 62672127a0..8df700d008 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # AlchemyCMS [![Gem Version](https://badge.fury.io/rb/alchemy_cms.svg)](http://badge.fury.io/rb/alchemy_cms) -[![Build Status](https://travis-ci.org/AlchemyCMS/alchemy_cms.svg?branch=master)](https://travis-ci.org/AlchemyCMS/alchemy_cms) +[![Build Status](https://github.com/AlchemyCMS/alchemy_cms/workflows/CI/badge.svg?branch=master)](https://github.com/AlchemyCMS/alchemy_cms/actions) [![Maintainability](https://api.codeclimate.com/v1/badges/196c56c56568ed24a697/maintainability)](https://codeclimate.com/github/AlchemyCMS/alchemy_cms/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/196c56c56568ed24a697/test_coverage)](https://codeclimate.com/github/AlchemyCMS/alchemy_cms/test_coverage) [![Depfu](https://badges.depfu.com/badges/ebe56d2dd7b7044a8ae700cc81212a8e/overview.svg)](https://depfu.com/github/AlchemyCMS/alchemy_cms?project_id=4600) diff --git a/spec/dummy/config/database.yml b/spec/dummy/config/database.yml index 9223533ff0..b9af7934bf 100644 --- a/spec/dummy/config/database.yml +++ b/spec/dummy/config/database.yml @@ -6,7 +6,7 @@ mysql: &mysql adapter: mysql2 encoding: utf8mb4 username: root - password: + password: <%= ENV['MYSQL_PASSWORD'] %> database: alchemy_cms_dummy_<%= Rails.env %> postgresql: &postgresql