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 9 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
5 changes: 3 additions & 2 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,19 @@ PATH_add bin
# export RUBYOPT="-W0"

### External Testing Controls
export COVERAGE=true
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
70 changes: 70 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ main, "*-stable" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main, "*-stable" ]
schedule:
- cron: '35 1 * * 5'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'ruby' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
94 changes: 67 additions & 27 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,57 @@
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'
- "main"
- "*-stable"
tags:
- '!*' # Do not execute on tags
- "!*" # Do not execute on tags
pull_request:
branches:
- '*'
- "*"
# 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 || '' }}
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]')"
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
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
env: # $BUNDLE_GEMFILE - set at job level, so applies to 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_name: "coverage"
exec_cmd: "rake test"
gemfile: "Appraisal.root"
rubygems: latest
bundler: latest

steps:
- name: Checkout
Expand All @@ -56,14 +63,47 @@ 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

# 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.ruby }}@${{ matrix.appraisal_name }}
run: bundle exec appraisal ${{ matrix.appraisal_name }} bundle
- name: Run ${{ matrix.exec_cmd }} on ${{ matrix.ruby }}@${{ matrix.appraisal_name }}
run: bundle exec appraisal ${{ matrix.appraisal_name }} bundle exec ${{ matrix.exec_cmd }}

- name: Run tests
run: bundle exec rake test
# 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' }}

# Build will fail here if coverage upload fails
# which will hopefully be noticed for the lack of code coverage comments
- name: Upload coverage to CodeCov
uses: codecov/codecov-action@v5
with:
use_oidc: true
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = 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 +113,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
87 changes: 87 additions & 0 deletions .github/workflows/current-runtime-heads.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Targets the evergreen latest release of ruby, truffleruby, and jruby
# and tests against the HEAD of runtime dependencies
name: Runtime Deps @ HEAD

permissions:
contents: read

env:
K_SOUP_COV_DO: false

on:
push:
branches:
- 'main'
- '*-stable'
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: Tests ${{ matrix.ruby }}@${{ matrix.appraisal_name }}
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 - set at job level, so applies to all steps
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}.gemfile
strategy:
matrix:
include:
# Ruby 3.4
- ruby: "ruby"
appraisal_name: "dep-heads"
exec_cmd: "rake test"
gemfile: "Appraisal.root"
rubygems: latest
bundler: latest

# truffleruby-24.1
- ruby: "truffleruby"
appraisal_name: "dep-heads"
exec_cmd: "rake test"
gemfile: "Appraisal.root"
rubygems: default
bundler: default

# jruby-10.0 (targets Ruby 3.4 compatibility)
- ruby: "jruby"
if: ${{ !env.ACT }}
appraisal_name: "dep-heads"
exec_cmd: "rake test"
gemfile: "Appraisal.root"
experimental: true
rubygems: default
bundler: default

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Ruby & RubyGems
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
rubygems: ${{ matrix.rubygems }}
bundler: ${{ matrix.bundler }}
bundler-cache: false

# 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.ruby }}@${{ matrix.appraisal_name }}
run: bundle exec appraisal ${{ matrix.appraisal_name }} bundle
- name: Run ${{ matrix.exec_cmd }} on ${{ matrix.ruby }}@${{ matrix.appraisal_name }}
run: bundle exec appraisal ${{ matrix.appraisal_name }} bundle exec ${{ matrix.exec_cmd }}
Loading
Loading