From 9b092ee362df8a46854d8dc42125963f86dadf2f Mon Sep 17 00:00:00 2001 From: Patrick Gansterer Date: Sat, 5 Sep 2020 15:51:48 +0200 Subject: [PATCH] Use GitHub Actions insted of Travis CI --- .github/workflows/ruby.yml | 55 ++++++++++++++++++++++++++++++++++++++ .travis.yml | 24 ----------------- README.md | 2 +- 3 files changed, 56 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/ruby.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml new file mode 100644 index 00000000..93d0c02b --- /dev/null +++ b/.github/workflows/ruby.yml @@ -0,0 +1,55 @@ +name: Ruby + +on: [push, pull_request] + +jobs: + test: + runs-on: ubuntu-latest + + services: + mariadb: + image: mariadb + env: + MYSQL_USER: user + MYSQL_PASSWORD: password + MYSQL_DATABASE: test + MYSQL_ROOT_PASSWORD: password + options: >- + --health-cmd "mysqladmin ping" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 3306:3306 + redis: + image: redis + options: >- + --health-cmd "redis-cli ping" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 6379:6379 + + steps: + - name: Checkout source code + uses: actions/checkout@v2 + - name: Setup chromedriver + uses: nanasess/setup-chromedriver@v1.0.1 + - name: Setup ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + - name: Initialize stock configuration + run: bundle exec rake foodsoft:setup:stock_config + - name: Load database schema + run: bundle exec rake db:schema:load + env: + DATABASE_URL: mysql2://user:password@127.0.0.1/test + RAILS_ENV: test + - name: Run tests + run: bundle exec rake rspec-rerun:spec + env: + COVERALLS: 1 + DATABASE_URL: mysql2://user:password@127.0.0.1/test + RAILS_ENV: test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 13219bed..00000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -language: ruby -dist: bionic -sudo: false -rvm: - - 2.6 -services: - - mysql - - redis-server -addons: - apt: - packages: - - libmagic-dev - chrome: stable -env: COVERALLS=1 -cache: bundler -bundler_args: - - "--without development --deployment --jobs=3 --retry=3" -before_script: - - "bundle exec rake foodsoft:setup:stock_config" - - "mysql -e 'create database foodsoft_test default character set utf8 default collate utf8_general_ci;'" - - "mysql -e 'grant all on foodsoft_test.* to travis;'" - - 'printf "test:\n adapter: mysql2\n database: foodsoft_test\n username: travis\n encoding: utf8\n" >config/database.yml' - - 'bundle exec rake db:schema:load RAILS_ENV=test' -script: bundle exec rake rspec-rerun:spec diff --git a/README.md b/README.md index 71fb4297..f2895977 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ Foodsoft ========= -[![Build Status](https://travis-ci.org/foodcoops/foodsoft.svg?branch=master)](https://travis-ci.org/foodcoops/foodsoft) +[![Build Status](https://github.com/foodcoops/foodsoft/workflows/Ruby/badge.svg)](https://github.com/foodcoops/foodsoft/actions) [![Coverage Status](https://coveralls.io/repos/foodcoops/foodsoft/badge.svg?branch=master)](https://coveralls.io/r/foodcoops/foodsoft?branch=master) [![Docs Status](https://inch-ci.org/github/foodcoops/foodsoft.svg?branch=master)](http://inch-ci.org/github/foodcoops/foodsoft) [![Code Climate](https://codeclimate.com/github/foodcoops/foodsoft.svg)](https://codeclimate.com/github/foodcoops/foodsoft)