Skip to content

Commit

Permalink
Enable Ruby testing github workflow (#1994)
Browse files Browse the repository at this point in the history
* Enable Ruby testing github workflow

* change `ruby-version` => `ruby` in matrix

* disable fail-fast

* Use lastest of each minor version

* add code climate reporting

the Travis builds reported results back to code climate, and this restores that.

@stympy We should move the the CC Reporter Id to the [repo's secrets](https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets) and regenerate it (for safety). I'm unable to do that as accessing the repo's secrets requires `admin` permissions.

* Use the GitHub action badge in the README

* link directly to tests
  • Loading branch information
Zeragamba committed May 20, 2020
1 parent 76fd538 commit c9b9c6e
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 1 deletion.
55 changes: 55 additions & 0 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby

name: Tests

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
name: Ruby ${{ matrix.ruby }}
runs-on: ubuntu-latest
strategy:
fail-fast: false # don't fail all matrix builds if one fails
matrix:
ruby:
- '2.3'
- '2.4'
- '2.5'
- '2.6'
- '2.7'
- 'head'
continue-on-error: ${{ endsWith(matrix.ruby, 'head') }}
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}

- name: Install dependencies
run: bundle install

- name: Setup 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: Run tests
run: bundle exec rake

- name: Publish code coverage
env:
CC_TEST_REPORTER_ID: c9b8356df2031a5a72462555fe898245cf24d83c7bb82c40ddb5c6c6976c4319
# CC_TEST_REPORTER_ID: ${{ secrets.CodeClimateReporterId }}
run: |
export GIT_BRANCH="${GITHUB_REF/refs\/heads\//}"
./cc-test-reporter after-build -r $CC_TEST_REPORTER_ID
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
![logotype a happy-07](https://user-images.githubusercontent.com/36028424/40263395-4318481e-5b44-11e8-92e5-3dcc1ce169b3.png)

# Faker
[![Build Status](https://travis-ci.org/faker-ruby/faker.svg?branch=master)](https://travis-ci.org/faker-ruby/faker)
[![Tests](https://github.com/faker-ruby/faker/workflows/Tests/badge.svg)](https://github.com/faker-ruby/faker/actions?query=workflow%3ATests)
[![Gem Version](https://badge.fury.io/rb/faker.svg)](https://badge.fury.io/rb/faker)
[![Inline docs](https://inch-ci.org/github/faker-ruby/faker.svg?branch=master)](https://inch-ci.org/github/faker-ruby/faker)
[![Test Coverage](https://api.codeclimate.com/v1/badges/ef54c7f9df86e965d64b/test_coverage)](https://codeclimate.com/github/stympy/faker/test_coverage)
Expand Down

0 comments on commit c9b9c6e

Please sign in to comment.