forked from mbleigh/omniauth-jwt
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
228 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,61 @@ | ||
name: Omniauth JWT Tests | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
- 'master' | ||
- 'main' | ||
tags: | ||
- '!*' # Do not execute on tags | ||
pull_request: | ||
branches: | ||
- '*' | ||
# Allow manually triggering the workflow. | ||
workflow_dispatch: | ||
|
||
# Cancels all previous workflow runs for the same branch that have not yet completed. | ||
concurrency: | ||
# The concurrency group contains the workflow name and the branch name. | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
name: Ruby ${{ matrix.ruby }} | ||
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps | ||
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile | ||
if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')" | ||
continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
ruby: ["2.7", "2.6", "2.5"] | ||
experimental: [false] | ||
rubygems: | ||
- latest | ||
bundler: | ||
- latest | ||
gemfile: | ||
- vanilla | ||
ruby: | ||
- "2.6" | ||
- "2.7" | ||
- "3.0" | ||
- "3.1" | ||
- "3.2" | ||
exclude: | ||
# Vanilla + 3.2 is effectively run by coverage workflow | ||
- gemfile: vanilla | ||
ruby: "3.2" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-ruby@v1 | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup Ruby & Bundle | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby }} | ||
- name: Bundler cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: vendor/bundle | ||
key: ${{ runner.os }}-${{ matrix.ruby }}-gems-${{ hashFiles('**/Gemfile.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ matrix.ruby }}-gems- | ||
- name: Setup gems | ||
run: | | ||
gem install bundler | ||
bundle config path vendor/bundle | ||
bundle install --jobs 4 | ||
rubygems: ${{ matrix.rubygems }} | ||
bundler: ${{ matrix.bundler }} | ||
bundler-cache: true | ||
- name: Tests | ||
run: bundle exec rspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
name: Code Coverage | ||
|
||
env: | ||
K_SOUP_COV_MIN_BRANCH: 100 | ||
K_SOUP_COV_MIN_LINE: 89 | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
- 'main' | ||
tags: | ||
- '!*' # Do not execute on tags | ||
pull_request: | ||
branches: | ||
- '*' | ||
# Allow manually triggering the workflow. | ||
workflow_dispatch: | ||
|
||
# Cancels all previous workflow runs for the same branch that have not yet completed. | ||
concurrency: | ||
# The concurrency group contains the workflow name and the branch name. | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
name: Specs with Coverage - Ruby ${{ matrix.ruby }} ${{ matrix.name_extra || '' }} | ||
if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')" | ||
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps | ||
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile | ||
CI_CODECOV: true | ||
COVER_ALL: true | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
experimental: [false] | ||
rubygems: | ||
- latest | ||
bundler: | ||
- latest | ||
gemfile: | ||
- coverage | ||
ruby: | ||
- "3.2" | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Ruby & Bundle | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby }} | ||
rubygems: ${{ matrix.rubygems }} | ||
bundler: ${{ matrix.bundler }} | ||
bundler-cache: true | ||
|
||
- name: Run RSpec tests | ||
run: | | ||
bundle exec rspec | ||
- name: Code Coverage Summary Report | ||
uses: irongut/CodeCoverageSummary@v1.3.0 | ||
if: ${{ github.event_name == 'pull_request' }} | ||
with: | ||
filename: ./coverage/coverage.xml | ||
badge: true | ||
fail_below_min: true | ||
format: markdown | ||
hide_branch_rate: false | ||
hide_complexity: true | ||
indicators: true | ||
output: both | ||
thresholds: '100 100' | ||
continue-on-error: ${{ matrix.experimental != 'false' }} | ||
|
||
- name: Add Coverage PR Comment | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
if: ${{ github.event_name == 'pull_request' }} | ||
with: | ||
recreate: true | ||
path: code-coverage-results.md | ||
continue-on-error: ${{ matrix.experimental != 'false' }} | ||
|
||
- name: Coveralls | ||
uses: coverallsapp/github-action@master | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
continue-on-error: ${{ matrix.experimental != 'false' }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
require "kettle/soup/cover/config" | ||
SimpleCov.start # you could do this somewhere else, up to you, but you do have to do it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ source 'https://rubygems.org' | |
|
||
# Specify your gem's dependencies in omniauth-jwt.gemspec | ||
gemspec | ||
|
||
gem 'byebug' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
require "bundler/gem_tasks" | ||
|
||
require "rspec/core/rake_task" | ||
RSpec::Core::RakeTask.new(:spec) | ||
|
||
desc "alias test task to spec" | ||
task test: :spec | ||
|
||
RSpec::Core::RakeTask.new | ||
require "kettle-soup-cover" | ||
Kettle::Soup::Cover.install_tasks | ||
|
||
task :default => :spec | ||
task default: :spec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# frozen_string_literal: true | ||
|
||
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" } | ||
|
||
source "https://rubygems.org" | ||
|
||
# Gemfile is only for local development. | ||
# On CI we only need the gemspecs' dependencies (including development dependencies). | ||
# Exceptions, if any, will be found in gemfiles/* | ||
gem "kettle-soup-cover", "~> 1.0", ">= 1.0.2" | ||
|
||
gemspec path: "../" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# frozen_string_literal: true | ||
|
||
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" } | ||
|
||
source "https://rubygems.org" | ||
|
||
# Gemfile is only for local development. | ||
# On CI we only need the gemspecs' dependencies (including development dependencies). | ||
# Exceptions, if any, will be found in gemfiles/* | ||
|
||
gemspec path: "../" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# frozen_string_literal: true | ||
|
||
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" } | ||
|
||
source "https://rubygems.org" | ||
|
||
# Gemfile is only for local development. | ||
# On CI we only need the gemspecs' dependencies (including development dependencies). | ||
# Exceptions, if any, will be found in gemfiles/* | ||
|
||
gemspec path: "../" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.