From 90476a07ec64b0994c3d799ca3d43dd87a466ba5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Dahlgren?= Date: Mon, 1 Apr 2024 22:24:59 +0200 Subject: [PATCH] Migrate to GitHub Actions --- .github/workflows/ruby.yml | 41 ++++++++++++++++++++++++++++++++++++++ .travis.yml | 24 ---------------------- 2 files changed, 41 insertions(+), 24 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 0000000..d04a315 --- /dev/null +++ b/.github/workflows/ruby.yml @@ -0,0 +1,41 @@ +name: "Ruby on Rails CI" + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + test: + runs-on: ubuntu-20.04 + services: + mysql: + image: mysql:5.5 + ports: + - "3306:3306" + env: + MYSQL_ROOT_PASSWORD: root + env: + RAILS_ENV: test + MYSQL_HOST: 127.0.0.1 + MYSQL_USERNAME: root + MYSQL_PASSWORD: root + MYSQL_DATABASE: rails + MYSQL_TEST_DATABASE: rails_test + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install Ruby and gems + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + + - name: Setup database + run: bundle exec rails db:setup + + - name: Run tests + run: bundle exec rspec diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index aa52635..0000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -dist: trusty -sudo: required - -language: ruby -rvm: - - 2.6.7 - -cache: bundler - -services: - - mysql - -env: - MYSQL_HOST: localhost - MYSQL_USERNAME: root - MYSQL_PASSWORD: - MYSQL_DATABASE: anrop - MYSQL_TEST_DATABASE: anrop_test - -before_script: - - bundle exec rails db:setup - -script: - - bundle exec rspec