Skip to content

[WIP] Next Release #59

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ export K_SOUP_COV_DO=true # Means you want code coverage
# Available formats are html, xml, rcov, lcov, json, tty
export K_SOUP_COV_COMMAND_NAME="MiniTest Coverage"
export K_SOUP_COV_FORMATTERS="html,tty"
export K_SOUP_COV_MIN_BRANCH=86 # Means you want to enforce X% branch coverage
export K_SOUP_COV_MIN_BRANCH=85 # Means you want to enforce X% branch coverage
export K_SOUP_COV_MIN_LINE=91 # Means you want to enforce X% line coverage
export K_SOUP_COV_MIN_HARD=true # Means you want the build to fail if the coverage thresholds are not met
export K_SOUP_COV_MULTI_FORMATTERS=true
export MAX_ROWS=1 # Setting for simplecov-console gem for tty output, limits to the worst N rows of bad coverage

# Internal Debugging Controls
export DEBUG=false # do not allow byebug statements (override in .env.local)
export DEBUG=false # do not allow debug statements (override in .env.local)

# .env would override anything in this file, if `dotenv` is uncommented below.
# .env is a DOCKER standard, and if we use it, it would be in deployed, or DOCKER, environments,
Expand Down
81 changes: 56 additions & 25 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
name: Ruby - Coverage
name: Test Coverage

permissions:
contents: read
pull-requests: write
id-token: write

env:
K_SOUP_COV_MIN_BRANCH: 86
K_SOUP_COV_MIN_BRANCH: 85
K_SOUP_COV_MIN_LINE: 91
K_SOUP_COV_MIN_HARD: true
K_SOUP_COV_FORMATTERS: "html,xml,rcov,lcov,json,tty"
K_SOUP_COV_DO: true
K_SOUP_COV_COMMAND_NAME: "MiniTest Coverage"
K_SOUP_COV_MULTI_FORMATTERS: true
K_SOUP_COV_COMMAND_NAME: "Test Coverage"

on:
push:
branches:
- 'main'
- '*-stable'
tags:
- '!*' # Do not execute on tags
pull_request:
Expand All @@ -19,32 +27,31 @@ on:
# Allow manually triggering the workflow.
workflow_dispatch:

permissions:
contents: read

# 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
coverage:
name: Code Coverage on ${{ matrix.ruby }}@current
if: ${{!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')}}
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
env: # $BUNDLE_GEMFILE must be set at job level, so it is set for all steps
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}.gemfile
strategy:
fail-fast: false
matrix:
rubygems:
- latest
bundler:
- latest
gemfile:
- coverage
ruby:
- '3.1'
include:
# Coverage
- ruby: "ruby"
appraisal: "coverage"
exec_cmd: "rake test"
gemfile: "Appraisal.root"
rubygems: latest
bundler: latest

steps:
- name: Checkout
Expand All @@ -56,14 +63,38 @@ jobs:
ruby-version: "${{ matrix.ruby }}"
rubygems: "${{ matrix.rubygems }}"
bundler: "${{ matrix.bundler }}"
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
bundler-cache: true

- name: Run tests
run: bundle exec rake test
# Raw `bundle` will use the BUNDLE_GEMFILE set to matrix.gemfile (i.e. Appraisal.root)
# We need to do this first to get appraisal installed.
# NOTE: This does not use the primary Gemfile at all.
# - name: Install Root Appraisal
# run: bundle
- name: Appraisal for ${{ matrix.appraisal }}
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
- name: Tests for ${{ matrix.ruby }}@current via ${{ matrix.exec_cmd }}
run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}

# Do SaaS coverage uploads first
- name: Upload coverage to Coveralls
if: ${{ !env.ACT }}
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: ${{ matrix.experimental != 'false' }}

- name: Upload coverage to QLTY
if: ${{ !env.ACT }}
uses: qltysh/qlty-action/coverage@main
with:
token: ${{secrets.QLTY_COVERAGE_TOKEN}}
files: coverage/.resultset.json
continue-on-error: ${{ matrix.experimental != 'false' }}

# Then PR comments
- name: Code Coverage Summary Report
if: ${{ !env.ACT && github.event_name == 'pull_request' }}
uses: irongut/[email protected]
if: ${{ github.event_name == 'pull_request' }}
with:
filename: ./coverage/coverage.xml
badge: true
Expand All @@ -73,12 +104,12 @@ jobs:
hide_complexity: true
indicators: true
output: both
thresholds: '91 86'
thresholds: '91 85'
continue-on-error: ${{ matrix.experimental != 'false' }}

- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: ${{ github.event_name == 'pull_request' }}
if: ${{ !env.ACT && github.event_name == 'pull_request' }}
with:
recreate: true
path: code-coverage-results.md
Expand Down
6 changes: 6 additions & 0 deletions .idea/GitLink.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 0 additions & 15 deletions .idea/git_toolbox_prj.xml

This file was deleted.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/ruby-openid2.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading