Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite continuous integration configuration #62

Merged
merged 4 commits into from
Jun 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 0 additions & 45 deletions .github/workflows/macos.yml

This file was deleted.

123 changes: 123 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: Tests

on:
- push
- pull_request

jobs:
rspec:
name: >-
${{ matrix.allow-failures && '~' }}
${{ matrix.ruby }};
${{ matrix.gemfile }};
${{ matrix.backend }}

runs-on: ubuntu-latest

continue-on-error: ${{ !! matrix.allow-failures }}

strategy:
fail-fast: false
matrix:
ruby:
- 2.7
- 2.6
- 2.5
- 2.4
- 2.3
- jruby
gemfile:
- Rails-5_2
- Rails-5_1
- Rails-5_0
backend:
- sqlite3
- mysql
- postgresql
include:
# Allow test failures for some configurations
- ruby: 2.3
allow-failures: true
- ruby: jruby
allow-failures: true

env:
# For Bundler control variables, refer to:
# https://bundler.io/v1.17/bundle_config.html
BUNDLE_GEMFILE: ${{ format('gemfiles/{0}.gemfile', matrix.gemfile) }}

steps:
- uses: actions/checkout@v2

- name: Install APT packages
run: sudo apt-get install -y libsqlite3-dev

- name: Use Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}

- name: Install gems
run: |
gem install bundler
bundle install --jobs 4 --retry 3

- name: Write database configuration
run: |
cat <<EOF > spec/support/database.yml
sqlite3:
adapter: sqlite3
database: ":memory:"
postgresql:
adapter: postgresql
host: localhost
username: postgres
password: verysecret
database: activeid_test
mysql:
adapter: mysql2
host: 127.0.0.1
port: 3306
username: root
password: verysecret
database: activeid_test
encoding: utf8mb4
EOF

- name: Run tests (with monkey patches)
run: bundle exec rspec
env:
DB: ${{ matrix.backend }}

- name: Run tests (without monkey patches)
run: bundle exec rspec
env:
DB: ${{ matrix.backend }}
NO_PATCHES: 1

services:
mariadb:
image: mariadb:latest
env:
MYSQL_ROOT_PASSWORD: verysecret
MYSQL_DATABASE: activeid_test
options: >-
--health-cmd="mysqladmin ping"
--health-interval=7s
--health-timeout=5s
--health-retries=10
ports:
- 3306:3306

postgresql:
image: postgres:latest
env:
POSTGRES_DB: activeid_test
POSTGRES_PASSWORD: verysecret
options: >-
--health-cmd="pg_isready"
--health-interval=7s
--health-timeout=5s
--health-retries=10
ports:
- 5432:5432
47 changes: 0 additions & 47 deletions .github/workflows/ubuntu.yml

This file was deleted.

40 changes: 0 additions & 40 deletions .github/workflows/windows.yml

This file was deleted.

4 changes: 1 addition & 3 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ endif::[]
// Badges
ifdef::env-github[]
image:https://img.shields.io/gem/v/activeid.svg["Gem Version", link="https://rubygems.org/gems/activeid"]
image:https://github.com/riboseinc/activeid/workflows/macos/badge.svg["Build Status (macOS)", link="https://github.com/riboseinc/activeid/actions?workflow=macos"]
image:https://github.com/riboseinc/activeid/workflows/ubuntu/badge.svg["Build Status (ubuntu)", link="https://github.com/riboseinc/activeid/actions?workflow=ubuntu"]
image:https://github.com/riboseinc/activeid/workflows/windows/badge.svg["Build Status (Windows)", link="https://github.com/riboseinc/activeid/actions?workflow=windows"]
image:https://github.com/riboseinc/activeid/workflows/Tests/badge.svg?branch=master["CI Status", link="https://github.com/riboseinc/activeid/actions?workflow=Tests"]
image:https://codeclimate.com/github/riboseinc/activeid/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/riboseinc/activeid"]
image:https://img.shields.io/github/issues-pr-raw/riboseinc/activeid.svg["Pull Requests", link="https://github.com/riboseinc/activeid/pulls"]
image:https://img.shields.io/github/commits-since/riboseinc/activeid/latest.svg["Commits since latest",link="https://github.com/riboseinc/activeid/releases"]
Expand Down