Skip to content

Commit 6182027

Browse files
authored
πŸ”€ Merge pull request #207 from oauth-xx/issue/202-github-actions-for-ci
πŸ‘· Switch to GitHub Actions
2 parents 172b2a3 + 819c964 commit 6182027

File tree

7 files changed

+117
-25
lines changed

7 files changed

+117
-25
lines changed

β€Ž.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: bundler
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
time: "04:30"
8+
open-pull-requests-limit: 10

β€Ž.github/workflows/supported.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Supported Rubies
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- '*-maintenance'
8+
- '*-dev'
9+
tags:
10+
- '!*' # Do not execute on tags
11+
pull_request:
12+
branches:
13+
- '*'
14+
15+
jobs:
16+
test:
17+
name: Specs - Ruby ${{ matrix.ruby }} ${{ matrix.name_extra || '' }}
18+
if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
ruby:
23+
- truffleruby-head
24+
- ruby-head
25+
- 3.0
26+
- 2.7
27+
- 2.6
28+
runs-on: ubuntu-latest
29+
continue-on-error: ${{ matrix.allow_failure || endsWith(matrix.ruby, 'head') }}
30+
steps:
31+
- uses: amancevice/setup-code-climate@v0
32+
name: CodeClimate Install
33+
if: matrix.ruby == '2.6' && github.event_name != 'pull_request'
34+
with:
35+
cc_test_reporter_id: ${{ secrets.CC_TEST_REPORTER_ID }}
36+
- name: Checkout
37+
uses: actions/checkout@v2
38+
- name: Install cURL Headers
39+
run: sudo apt-get install libcurl4-openssl-dev
40+
- name: Setup Ruby & Bundle
41+
uses: ruby/setup-ruby@v1
42+
with:
43+
ruby-version: ${{ matrix.ruby }}
44+
bundler-cache: true
45+
- name: CodeClimate Pre-build Notification
46+
run: cc-test-reporter before-build
47+
if: matrix.ruby == '2.6' && github.event_name != 'pull_request'
48+
continue-on-error: ${{ matrix.allow_failures != 'false' }}
49+
- name: Run tests
50+
run: bundle exec rake test
51+
- uses: codecov/codecov-action@v2
52+
with:
53+
flags: unittests
54+
name: codecov-upload
55+
fail_ci_if_error: true
56+
- name: CodeClimate Post-build Notification
57+
run: cc-test-reporter after-build
58+
if: matrix.ruby == '2.6' && github.event_name != 'pull_request' && always()
59+
continue-on-error: ${{ matrix.allow_failures != 'false' }}

β€Ž.github/workflows/unsupported.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Unsupported Rubies
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- '*-maintenance'
8+
- '*-dev'
9+
tags:
10+
- '!*' # Do not execute on tags
11+
pull_request:
12+
branches:
13+
- '*'
14+
15+
jobs:
16+
test:
17+
name: Specs - Ruby ${{ matrix.ruby }} ${{ matrix.name_extra || '' }}
18+
if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
ruby:
23+
- 2.5
24+
- 2.4
25+
- 2.3
26+
runs-on: ubuntu-18.04
27+
continue-on-error: ${{ matrix.allow_failure || endsWith(matrix.ruby, 'head') }}
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v2
31+
- name: Install cURL Headers
32+
run: sudo apt-get install libcurl4-openssl-dev
33+
- name: Setup Ruby & Bundle
34+
uses: ruby/setup-ruby@v1
35+
with:
36+
ruby-version: ${{ matrix.ruby }}
37+
bundler-cache: true
38+
- name: Run tests
39+
run: bundle exec rake test

β€Ž.simplecov

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# frozen_string_literal: true
2+
3+
SimpleCov.start do
4+
add_filter "/spec/"
5+
end

β€Ž.travis.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

β€Žoauth.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Gem::Specification.new do |spec|
4545
spec.add_development_dependency("em-http-request", "~> 1.1.7")
4646
spec.add_development_dependency("curb")
4747
spec.add_development_dependency("webmock", "< 2.0")
48-
spec.add_development_dependency("codeclimate-test-reporter")
49-
spec.add_development_dependency("simplecov")
5048
spec.add_development_dependency("rest-client")
49+
spec.add_development_dependency("simplecov")
50+
spec.add_development_dependency("simplecov-cobertura", "~> 1.4")
5151
end

β€Žtest/test_helper.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
ENV['RACK_ENV'] = 'test'
44

5-
# simplecov, Travis will call codeclimate
6-
7-
require 'simplecov'
8-
SimpleCov.start
5+
# Code coverage
6+
require "simplecov"
7+
require "simplecov-cobertura"
8+
SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter unless ENV["HTML_COVERAGE"] == "true"
99

1010
# require third-party code
1111

0 commit comments

Comments
Β (0)