From eb47e7ac7aa36b72b286c263151bdd92e59adca6 Mon Sep 17 00:00:00 2001 From: Jason Frey Date: Thu, 3 Feb 2022 16:21:22 -0500 Subject: [PATCH] Switch to GitHub Actions --- .github/workflows/ci.yaml | 43 +++++++++++++++++++++++++++++++++++++++ .travis.yml | 15 -------------- README.md | 2 +- bin/ci/after_script | 3 --- bin/setup | 8 ++------ bin/update | 5 +---- bundler.d/.gitkeep | 0 manageiq-schema.gemspec | 2 +- 8 files changed, 48 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/ci.yaml delete mode 100644 .travis.yml delete mode 100755 bin/ci/after_script mode change 100755 => 120000 bin/update delete mode 100644 bundler.d/.gitkeep diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 000000000..745c78978 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,43 @@ +name: CI + +on: [push, pull_request] + +jobs: + ci: + runs-on: ubuntu-latest + strategy: + matrix: + ruby-version: + - '2.6' + - '2.7' + rails-version: + - '6.0' + - '6.1' + services: + postgres: + image: manageiq/postgresql:10 + env: + POSTGRESQL_USER: root + POSTGRESQL_PASSWORD: smartvm + POSTGRESQL_DATABASE: vmdb_test + options: --health-cmd pg_isready --health-interval 2s --health-timeout 5s --health-retries 5 + ports: + - 5432:5432 + env: + TEST_RAILS_VERSION: ${{ matrix.rails-version }} + CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} + steps: + - uses: actions/checkout@v2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + bundler-cache: true + - name: Prepare tests + run: bin/setup + - name: Run tests + run: bundle exec rake + - name: Report code coverage + if: ${{ github.ref == 'refs/heads/master' && matrix.ruby-version == '2.7' }} + continue-on-error: true + uses: paambaati/codeclimate-action@v3.0.0 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ea0ecf272..000000000 --- a/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -language: ruby -cache: bundler -rvm: -- 2.6.6 -- 2.7.2 -env: - matrix: - - TEST_RAILS_VERSION=6.1 - - TEST_RAILS_VERSION=6.0 -addons: - postgresql: '10' -install: bin/setup -after_script: bin/ci/after_script -dist: bionic diff --git a/README.md b/README.md index 0854ffb99..1ad51711b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # ManageIQ::Schema -[![Build Status](https://travis-ci.com/ManageIQ/manageiq-schema.svg?branch=master)](https://travis-ci.com/github/ManageIQ/manageiq-schema) +[![CI](https://github.com/ManageIQ/manageiq-schema/actions/workflows/ci.yaml/badge.svg)](https://github.com/ManageIQ/manageiq-schema/actions/workflows/ci.yaml) [![Maintainability](https://api.codeclimate.com/v1/badges/f7888b08eb72806b2860/maintainability)](https://codeclimate.com/github/ManageIQ/manageiq-schema/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/f7888b08eb72806b2860/test_coverage)](https://codeclimate.com/github/ManageIQ/manageiq-schema/test_coverage) diff --git a/bin/ci/after_script b/bin/ci/after_script deleted file mode 100755 index c2a335bcc..000000000 --- a/bin/ci/after_script +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT diff --git a/bin/setup b/bin/setup index a919ea46a..882ee02a4 100755 --- a/bin/setup +++ b/bin/setup @@ -1,12 +1,8 @@ #!/bin/bash -if [[ -n "$CI" ]]; then - echo 'gem: --no-ri --no-rdoc --no-document' > ~/.gemrc - bundle config --local path $(pwd)/vendor/bundle - psql -c "CREATE USER root SUPERUSER PASSWORD 'smartvm';" -U postgres +if [ -z "$CI" ]; then + bundle update --jobs=3 fi cp -n spec/dummy/config/database.{tmpl.,}yml - -bundle update --jobs=3 bundle exec rake spec:setup diff --git a/bin/update b/bin/update deleted file mode 100755 index 26fbeaee2..000000000 --- a/bin/update +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -bundle update --jobs=3 -bundle exec rake spec:setup diff --git a/bin/update b/bin/update new file mode 120000 index 000000000..c9dd658e2 --- /dev/null +++ b/bin/update @@ -0,0 +1 @@ +./setup \ No newline at end of file diff --git a/bundler.d/.gitkeep b/bundler.d/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/manageiq-schema.gemspec b/manageiq-schema.gemspec index 3c3119d63..c8c0243f6 100644 --- a/manageiq-schema.gemspec +++ b/manageiq-schema.gemspec @@ -29,5 +29,5 @@ Gem::Specification.new do |spec| spec.add_development_dependency "manageiq-style" spec.add_development_dependency "rspec" spec.add_development_dependency "rspec-rails" - spec.add_development_dependency "simplecov" + spec.add_development_dependency "simplecov", ">= 0.21.2" end