Skip to content

Commit

Permalink
Migrate to GitHub Actions and CI against ruby 2.7, 2.8
Browse files Browse the repository at this point in the history
  • Loading branch information
sue445 committed Jan 1, 2020
1 parent 19cbb27 commit 3c7d3b4
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 31 deletions.
133 changes: 133 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
name: test

on:
push:
schedule:
- cron: "0 10 * * 5" # JST 19:00 (Fri)

env:
CI: "true"

jobs:
test:
runs-on: ${{ matrix.runner }}

strategy:
fail-fast: false

matrix:
ruby:
- 2.2.2
- 2.3.0
- 2.4.0
- 2.5.0
- 2.6.0
- 2.7.0
- 2.8.0-dev
include:
- ruby: 2.2.2
runner: ubuntu-16.04
- ruby: 2.3.0
runner: ubuntu-16.04
- ruby: 2.4.0
runner: ubuntu-latest
- ruby: 2.5.0
runner: ubuntu-latest
- ruby: 2.6.0
runner: ubuntu-latest
- ruby: 2.7.0
runner: ubuntu-latest
- ruby: 2.8.0-dev
runner: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up rbenv
uses: masa-iwasaki/setup-rbenv@1.1.0

- name: Cache RBENV_ROOT
uses: actions/cache@v1
id: cache_rbenv
with:
path: ~/.rbenv/versions
key: v1-rbenv-${{ runner.os }}-${{ matrix.ruby }}
if: "!endsWith(matrix.ruby, '-dev')"

- name: Reinstall libssl-dev
run: |
set -xe
sudo apt-get remove -y libssl-dev
sudo apt-get install -y libssl-dev=1.0.2g-1ubuntu4.15
if: matrix.runner == 'ubuntu-16.04'

- name: Install Ruby
run: |
set -xe
eval "$(rbenv init -)"
rbenv install -s $RBENV_VERSION
gem install bundler --no-document -v 1.17.3 || true
env:
RBENV_VERSION: ${{ matrix.ruby }}
continue-on-error: ${{ endsWith(matrix.ruby, '-dev') }}

- name: Generate unique cache key
run: uuidgen > uuid.txt

- name: Cache vendor/bundle
uses: actions/cache@v1
id: cache_gem
with:
path: vendor/bundle
key: v1-gem-${{ runner.os }}-${{ matrix.ruby }}-${{ hashFiles('uuid.txt') }}
restore-keys: |
v1-gem-${{ runner.os }}-${{ matrix.ruby }}-
continue-on-error: ${{ endsWith(matrix.ruby, '-dev') }}

- name: bundle update
run: |
set -xe
eval "$(rbenv init -)"
bundle config path vendor/bundle
bundle update --jobs $(nproc) --retry 3
env:
RBENV_VERSION: ${{ matrix.ruby }}
continue-on-error: ${{ endsWith(matrix.ruby, '-dev') }}

- name: Run test
run: |
set -xe
eval "$(rbenv init -)"
bundle exec rspec
bundle exec ruby examples/all.rb
env:
RBENV_VERSION: ${{ matrix.ruby }}
continue-on-error: ${{ endsWith(matrix.ruby, '-dev') }}

- name: Slack Notification (not success)
uses: homoluctus/slatify@v2.0.0
if: "! success()"
with:
job_name: ${{ format('*build* ({0})', matrix.ruby) }}
type: ${{ job.status }}
icon_emoji: ":octocat:"
url: ${{ secrets.SLACK_WEBHOOK }}
token: ${{ secrets.GITHUB_TOKEN }}

notify:
needs:
- test

runs-on: ubuntu-latest

steps:
- name: Slack Notification (success)
uses: homoluctus/slatify@v2.0.0
if: always()
with:
job_name: '*build*'
type: ${{ job.status }}
icon_emoji: ":octocat:"
url: ${{ secrets.SLACK_WEBHOOK }}
token: ${{ secrets.GITHUB_TOKEN }}
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Test data generator using Precure(Pretty Cure)

[![Gem Version](https://badge.fury.io/rb/faker-precure.svg)](http://badge.fury.io/rb/faker-precure)
[![Build Status](https://travis-ci.org/sue445/faker-precure.svg?branch=master)](https://travis-ci.org/sue445/faker-precure)
[![Build Status](https://github.com/sue445/faker-precure/workflows/test/badge.svg?branch=master)](https://github.com/sue445/faker-precure/actions?query=workflow%3Atest)
[![Code Climate](https://codeclimate.com/github/sue445/faker-precure.png)](https://codeclimate.com/github/sue445/faker-precure)
[![Coverage Status](https://coveralls.io/repos/sue445/faker-precure/badge.png)](https://coveralls.io/r/sue445/faker-precure)

Expand Down

0 comments on commit 3c7d3b4

Please sign in to comment.