Skip to content

Commit

Permalink
Move CI to GitHub actions (#1654)
Browse files Browse the repository at this point in the history
* Add a GitHub actions ci.yml

* Split up github build steps

* Test with multiple databases on github actions ci

* Give bundler more time to install

* Report test results to codeclimate

* Remove travis.yml

Since we now run our tests on Github Actions CI we do not need this
anymore.

* Rename Github workflow

* Update status badge

* Uploads build artifacts if build fails
  • Loading branch information
tvdeyen authored Oct 22, 2019
1 parent c723067 commit 411fc9d
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 31 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: CI

on: [push, pull_request]

jobs:
RSpec:
runs-on: ubuntu-latest
strategy:
matrix:
ruby:
- '2.5.x'
- '2.6.x'
database:
- mysql
- postgresql
env:
DB: ${{ matrix.database }}
MYSQL_PASSWORD: root
PGHOST: 127.0.0.1
PGUSER: postgres
RAILS_ENV: test
CC_TEST_REPORTER_ID: bca4349e32f97919210ac8a450b04904b90683fcdd57d65a22c0f5065482bc22
services:
postgres:
image: postgres:10
ports: ['5432:5432']
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v1
- name: Set up Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Install Postgres headers
if: matrix.database == 'postgresql'
run: |
sudo apt-get install -yqq libpq-dev
- name: Install MySQL headers
if: matrix.database == 'mysql'
run: |
sudo apt-get install -yqq libmysqlclient-dev
- name: Install bundle
timeout-minutes: 10
run: |
gem install bundler
bundle install --jobs 4 --retry 3
- name: Prepare database
run: |
bundle exec rake alchemy:spec:prepare
- name: Install code climate test reporter
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
- name: Test with RSpec
run: |
bundle exec rspec
./cc-test-reporter after-build --exit-code $?
- uses: actions/upload-artifact@master
if: failure()
with:
name: Screenshots
path: spec/dummy/tmp/screenshots
26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

3 changes: 0 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ gem 'sassc-rails'
group :development, :test do
gem 'simplecov', require: false
gem 'bootsnap', require: false
if ENV['TRAVIS']
gem 'codeclimate-test-reporter', '~> 1.0', require: false
end
unless ENV['CI']
gem 'launchy'
gem 'annotate'
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# AlchemyCMS

[![Gem Version](https://badge.fury.io/rb/alchemy_cms.svg)](http://badge.fury.io/rb/alchemy_cms)
[![Build Status](https://travis-ci.org/AlchemyCMS/alchemy_cms.svg?branch=master)](https://travis-ci.org/AlchemyCMS/alchemy_cms)
[![Build Status](https://github.com/AlchemyCMS/alchemy_cms/workflows/CI/badge.svg?branch=master)](https://github.com/AlchemyCMS/alchemy_cms/actions)
[![Maintainability](https://api.codeclimate.com/v1/badges/196c56c56568ed24a697/maintainability)](https://codeclimate.com/github/AlchemyCMS/alchemy_cms/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/196c56c56568ed24a697/test_coverage)](https://codeclimate.com/github/AlchemyCMS/alchemy_cms/test_coverage)
[![Depfu](https://badges.depfu.com/badges/ebe56d2dd7b7044a8ae700cc81212a8e/overview.svg)](https://depfu.com/github/AlchemyCMS/alchemy_cms?project_id=4600)
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ mysql: &mysql
adapter: mysql2
encoding: utf8mb4
username: root
password:
password: <%= ENV['MYSQL_PASSWORD'] %>
database: alchemy_cms_dummy_<%= Rails.env %>

postgresql: &postgresql
Expand Down

0 comments on commit 411fc9d

Please sign in to comment.