diff --git a/.github/workflows/ruby-selenium.yml b/.github/workflows/ruby-selenium.yml new file mode 100644 index 0000000000..add21df789 --- /dev/null +++ b/.github/workflows/ruby-selenium.yml @@ -0,0 +1,53 @@ +# This is a basic workflow to help you get started with Actions + +name: Features + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the master branch + push: + branches: [ master ] + pull_request: + branches: [ master ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + strategy: + matrix: + ruby-version: ['2.7'] # , '2.7', '3.0' + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + - uses: actions/checkout@v2 + - name: Set up Ruby + # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby, + # change this to (see https://github.com/ruby/setup-ruby#versioning): + # uses: ruby/setup-ruby@v1 + uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e + with: + ruby-version: ${{ matrix.ruby-version }} + + - name: Setup chrome driver (for Selenium) + uses: nanasess/setup-chromedriver@master + # with: + # Optional: do not specify to match Chrome's version + # chromedriver-version: '88.0.4324.96' + - run: | + export DISPLAY=:99 + chromedriver --url-base=/wd/hub & + sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional + + - name: Install dependencies + run: bundle install + - name: Prepare DB + run: DB=sqlite RAILS_ENV=test bundle exec rake spec:preparedb + + - name: Run RSpec on features + run: BROWSER=chrome DB=sqlite bundle exec rspec spec/features diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e6c4dab453..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,60 +0,0 @@ -sudo: false -language: ruby -rvm: - - 2.6.5 - - 2.7.1 - -dist: bionic - -env: - global: - - BROWSER=chrome - matrix: - - DB=postgres TEST_SUITE="rake spec:features" - - DB=postgres TEST_SUITE="rake spec:models" - - DB=mysql TEST_SUITE="rake spec:models" - -matrix: - fast_finish: true - allow_failures: - - rvm: 2.6.5 - env: DB=postgres TEST_SUITE="rake spec:features" - - rvm: 2.7.1 - env: DB=postgres TEST_SUITE="rake spec:features" - - rvm: 2.7.1 - env: DB=mysql TEST_SUITE="rake spec:models" - - -addons: - chrome: stable - -bundler_args: --path=vendor/bundle --without heroku - -cache: bundler - -before_script: - # gem update --system is a workaround for travis-ci/travis-ci#8978 - - "gem update --system" - - 'gem install bundler -v 1.17.3' - - sh -c "cp config/database.$DB.yml config/database.yml" - - sh -c "if [ \"$DB\" = 'postgres' ]; then psql -c 'create database fat_free_crm_test;' -U postgres; fi" - - sh -c "if [ \"$DB\" = 'mysql' ]; then mysql -e 'create database fat_free_crm_test;'; fi" - - "RAILS_ENV=test bundle exec rake spec:preparedb" - -# Run specs -script: - - "RAILS_ENV=test bundle exec $TEST_SUITE" - -notifications: - webhooks: - urls: - - https://webhooks.gitter.im/e/859260451e154d78c1be - on_success: change # options: [always|never|change] default: always - on_failure: always # options: [always|never|change] default: always - on_start: false # default: false - -dist: xenial -services: - - xvfb - - postgresql - - mysql