From 391dc49cd2dec9265dd348f8130331df580b0cc1 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 24 May 2021 11:10:37 +0930 Subject: [PATCH 1/4] Trial selenium tests --- .github/workflows/ruby-selenium.yml | 56 +++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/ruby-selenium.yml diff --git a/.github/workflows/ruby-selenium.yml b/.github/workflows/ruby-selenium.yml new file mode 100644 index 0000000000..6e2e6f577f --- /dev/null +++ b/.github/workflows/ruby-selenium.yml @@ -0,0 +1,56 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# 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: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + - 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 + + - 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: 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: DB=sqlite bundle exec rspec spec/features From 2fa404e048c0befe20e6691434c440ed25de8d4d Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 24 May 2021 11:14:12 +0930 Subject: [PATCH 2/4] Update ruby-selenium.yml --- .github/workflows/ruby-selenium.yml | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ruby-selenium.yml b/.github/workflows/ruby-selenium.yml index 6e2e6f577f..17694adc9e 100644 --- a/.github/workflows/ruby-selenium.yml +++ b/.github/workflows/ruby-selenium.yml @@ -1,6 +1,6 @@ # This is a basic workflow to help you get started with Actions -name: CI +name: Features # Controls when the action will run. on: @@ -25,8 +25,14 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - 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 @@ -38,15 +44,6 @@ jobs: chromedriver --url-base=/wd/hub & sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional - - 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: Install dependencies run: bundle install - name: Prepare DB From 3dd34f99d18ab9d120a792f47864465e966a095d Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Mon, 24 May 2021 11:22:28 +0930 Subject: [PATCH 3/4] Update ruby-selenium.yml --- .github/workflows/ruby-selenium.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ruby-selenium.yml b/.github/workflows/ruby-selenium.yml index 17694adc9e..add21df789 100644 --- a/.github/workflows/ruby-selenium.yml +++ b/.github/workflows/ruby-selenium.yml @@ -50,4 +50,4 @@ jobs: run: DB=sqlite RAILS_ENV=test bundle exec rake spec:preparedb - name: Run RSpec on features - run: DB=sqlite bundle exec rspec spec/features + run: BROWSER=chrome DB=sqlite bundle exec rspec spec/features From f8c93a79862f1018320c5aa56eea5c93c6ab8ebc Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Fri, 21 May 2021 21:05:38 +0930 Subject: [PATCH 4/4] Remove travis --- .travis.yml | 60 ----------------------------------------------------- 1 file changed, 60 deletions(-) delete mode 100644 .travis.yml 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