diff --git a/.envrc b/.envrc index c7c12683..5d53829b 100644 --- a/.envrc +++ b/.envrc @@ -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, diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 00000000..502c2a0e --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -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 diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 4b7116e8..e54ed48c 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,27 +1,32 @@ -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. @@ -29,22 +34,24 @@ concurrency: 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 - 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 @@ -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/CodeCoverageSummary@v1.3.0 - if: ${{ github.event_name == 'pull_request' }} with: filename: ./coverage/coverage.xml badge: true @@ -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 diff --git a/.github/workflows/current-runtime-heads.yml b/.github/workflows/current-runtime-heads.yml new file mode 100644 index 00000000..850ef2a7 --- /dev/null +++ b/.github/workflows/current-runtime-heads.yml @@ -0,0 +1,91 @@ +# 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" + appraisal_name: "dep-heads" + exec_cmd: "rake test" + gemfile: "Appraisal.root" + experimental: true + rubygems: default + bundler: default + + steps: + - name: Checkout + if: ${{ !env.ACT || !startsWith(matrix.ruby, 'jruby') }} + uses: actions/checkout@v4 + + - name: Setup Ruby & RubyGems + if: ${{ !env.ACT || !startsWith(matrix.ruby, 'jruby') }} + 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 + if: ${{ !env.ACT || !startsWith(matrix.ruby, 'jruby') }} + run: bundle + - name: Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal_name }} + if: ${{ !env.ACT || !startsWith(matrix.ruby, 'jruby') }} + run: bundle exec appraisal ${{ matrix.appraisal_name }} bundle + - name: Run ${{ matrix.exec_cmd }} on ${{ matrix.ruby }}@${{ matrix.appraisal_name }} + if: ${{ !env.ACT || !startsWith(matrix.ruby, 'jruby') }} + run: bundle exec appraisal ${{ matrix.appraisal_name }} bundle exec ${{ matrix.exec_cmd }} diff --git a/.github/workflows/current.yml b/.github/workflows/current.yml new file mode 100644 index 00000000..a4fb64e6 --- /dev/null +++ b/.github/workflows/current.yml @@ -0,0 +1,89 @@ +# Targets the evergreen latest release of ruby, truffleruby, and jruby +name: Current + +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: "3.4" + appraisal_name: "r3" + exec_cmd: "rake test" + gemfile: "Appraisal.root" + rubygems: latest + bundler: latest + + # truffleruby-24.1 + - ruby: "truffleruby" + appraisal_name: "r3" + exec_cmd: "rake test" + gemfile: "Appraisal.root" + rubygems: default + bundler: default + + # jruby-10.0 (targets Ruby 3.4 compatibility) + - ruby: "jruby" + appraisal_name: "r3" + exec_cmd: "rake test" + gemfile: "Appraisal.root" + rubygems: default + bundler: default + + steps: + - name: Checkout + if: ${{ !env.ACT || !startsWith(matrix.ruby, 'jruby') }} + uses: actions/checkout@v4 + + - name: Setup Ruby & RubyGems + if: ${{ !env.ACT || !startsWith(matrix.ruby, 'jruby') }} + 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 main Gemfile at all. + - name: Install Root Appraisal + if: ${{ !env.ACT || !startsWith(matrix.ruby, 'jruby') }} + run: bundle + - name: Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal_name }} + if: ${{ !env.ACT || !startsWith(matrix.ruby, 'jruby') }} + run: bundle exec appraisal ${{ matrix.appraisal_name }} bundle + - name: Run ${{ matrix.exec_cmd }} on ${{ matrix.ruby }}@${{ matrix.appraisal_name }} + if: ${{ !env.ACT || !startsWith(matrix.ruby, 'jruby') }} + run: bundle exec appraisal ${{ matrix.appraisal_name }} bundle exec ${{ matrix.exec_cmd }} diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml new file mode 100644 index 00000000..0d4a0136 --- /dev/null +++ b/.github/workflows/dependency-review.yml @@ -0,0 +1,20 @@ +# Dependency Review Action +# +# This Action will scan dependency manifest files that change as part of a Pull Request, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging. +# +# Source repository: https://github.com/actions/dependency-review-action +# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement +name: 'Dependency Review' +on: [pull_request] + +permissions: + contents: read + +jobs: + dependency-review: + runs-on: ubuntu-latest + steps: + - name: 'Checkout Repository' + uses: actions/checkout@v4 + - name: 'Dependency Review' + uses: actions/dependency-review-action@v4 diff --git a/.github/workflows/heads.yml b/.github/workflows/heads.yml index 89cb4cef..556f9114 100644 --- a/.github/workflows/heads.yml +++ b/.github/workflows/heads.yml @@ -1,4 +1,7 @@ -name: Ruby Heads Matrix +name: Heads + +permissions: + contents: read env: K_SOUP_COV_DO: false @@ -7,6 +10,7 @@ on: push: branches: - 'main' + - "*-stable" tags: - '!*' # Do not execute on tags pull_request: @@ -15,9 +19,6 @@ 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. @@ -26,35 +27,64 @@ concurrency: jobs: test: - name: Specs - 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 + name: Tests ${{ matrix.ruby }}@${{ matrix.appraisal_name }}${{ matrix.name_extra || '' }} + 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: fail-fast: true matrix: - rubygems: - - latest - bundler: - - latest - gemfile: - - vanilla - ruby: - - head + include: + # NOTE: Heads use default rubygems / bundler; their defaults are custom, unreleased, and from the future! + # ruby-head + - ruby: "ruby-head" + appraisal_name: "heads" + exec_cmd: "rake test" + gemfile: "Appraisal.root" + rubygems: default + bundler: default + +# # truffleruby-head + - ruby: "truffleruby-head" + appraisal_name: "heads" + exec_cmd: "rake test" + gemfile: "Appraisal.root" + rubygems: default + bundler: default + + # jruby-head + - ruby: "jruby-head" + appraisal_name: "heads" + exec_cmd: "rake test" + gemfile: "Appraisal.root" + rubygems: default + bundler: default steps: - name: Checkout + if: ${{ !env.ACT || !startsWith(matrix.ruby, 'jruby') }} uses: actions/checkout@v4 - name: Setup Ruby & RubyGems + if: ${{ !env.ACT || !startsWith(matrix.ruby, 'jruby') }} uses: ruby/setup-ruby@v1 with: - ruby-version: "${{ matrix.ruby }}" - rubygems: "${{ matrix.rubygems }}" - bundler: "${{ matrix.bundler }}" - bundler-cache: true # runs 'bundle install' and caches installed gems automatically + ruby-version: ${{ matrix.ruby }} + rubygems: ${{ matrix.rubygems }} + bundler: ${{ matrix.bundler }} + bundler-cache: false - - 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 main Gemfile at all. + - name: Install Root Appraisal + if: ${{ !env.ACT || !startsWith(matrix.ruby, 'jruby') }} + run: bundle + - name: Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal_name }} + if: ${{ !env.ACT || !startsWith(matrix.ruby, 'jruby') }} + run: bundle exec appraisal ${{ matrix.appraisal_name }} bundle + - name: Run ${{ matrix.exec_cmd }} on ${{ matrix.ruby }}@${{ matrix.appraisal_name }} + if: ${{ !env.ACT || !startsWith(matrix.ruby, 'jruby') }} + run: bundle exec appraisal ${{ matrix.appraisal_name }} bundle exec ${{ matrix.exec_cmd }} diff --git a/.github/workflows/jruby.yml b/.github/workflows/jruby.yml new file mode 100644 index 00000000..ab7ef922 --- /dev/null +++ b/.github/workflows/jruby.yml @@ -0,0 +1,72 @@ +name: JRuby + +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 }}${{ matrix.name_extra || '' }} + if: ${{ !contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]') }} + runs-on: ubuntu-22.04 + 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: + # jruby-9.4 (targets Ruby 3.1 compatibility) + - ruby: "jruby-9.4" + appraisal_name: "r3" + exec_cmd: "rake test" + gemfile: "Appraisal.root" + rubygems: default + bundler: default + + steps: + - name: Checkout + if: ${{ !env.ACT || !startsWith(matrix.ruby, 'jruby') }} + uses: actions/checkout@v4 + + - name: Setup Ruby & RubyGems + if: ${{ !env.ACT || !startsWith(matrix.ruby, 'jruby') }} + 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 main Gemfile at all. + - name: Install Root Appraisal + if: ${{ !env.ACT || !startsWith(matrix.ruby, 'jruby') }} + run: bundle + - name: Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal_name }} + if: ${{ !env.ACT || !startsWith(matrix.ruby, 'jruby') }} + run: bundle exec appraisal ${{ matrix.appraisal_name }} bundle + - name: Run ${{ matrix.exec_cmd }} on ${{ matrix.ruby }}@${{ matrix.appraisal_name }} + if: ${{ !env.ACT || !startsWith(matrix.ruby, 'jruby') }} + run: bundle exec appraisal ${{ matrix.appraisal_name }} bundle exec ${{ matrix.exec_cmd }} diff --git a/.github/workflows/legacy.yml b/.github/workflows/legacy.yml new file mode 100644 index 00000000..c70833a7 --- /dev/null +++ b/.github/workflows/legacy.yml @@ -0,0 +1,68 @@ +name: MRI 3.0 (Legacy) + +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 }}${{ matrix.name_extra || '' }} + if: ${{ !contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]') }} + runs-on: ubuntu-22.04 + 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: + include: + # Ruby 3.0 + - ruby: "3.0" + appraisal_name: "r3" + exec_cmd: "rake test" + gemfile: "Appraisal.root" + rubygems: '3.5.23' + bundler: '2.5.23' + + 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 main 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 }} diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 26b1f149..81d7b6ee 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -1,42 +1,65 @@ -name: Ruby - Style +name: Style + +permissions: + contents: read 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: rubocop: - name: RuboCop + name: Style 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 - 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: - - style - ruby: - - "3.2" - runs-on: ubuntu-latest - continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }} - 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 + include: + # Style + - ruby: "ruby" + appraisal_name: "style" + exec_cmd: "rake rubocop_gradual:check" + gemfile: "Appraisal.root" + rubygems: latest + bundler: latest + 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: true - - name: Run RuboCop - run: bundle exec rake rubocop_gradual:check + 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 main 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 }} diff --git a/.github/workflows/supported.yml b/.github/workflows/supported.yml index aadd9afa..f2c2adcf 100644 --- a/.github/workflows/supported.yml +++ b/.github/workflows/supported.yml @@ -1,4 +1,7 @@ -name: Supported Ruby Matrix +name: MRI (Supported) + +permissions: + contents: read env: K_SOUP_COV_DO: false @@ -7,6 +10,7 @@ on: push: branches: - 'main' + - "*-stable" tags: - '!*' # Do not execute on tags pull_request: @@ -15,9 +19,6 @@ 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. @@ -26,32 +27,57 @@ concurrency: jobs: test: - name: Specs - 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 + name: Tests ${{ matrix.ruby }} ${{ matrix.appraisal_name }}${{ matrix.name_extra || '' }} + 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.3" + # Ruby 3.1 + - ruby: "3.1" + appraisal_name: "r3-set-2" + exec_cmd: "rake test" + gemfile: "Appraisal.root" rubygems: latest bundler: latest - gemfile: vanilla + + # Ruby 3.2 - ruby: "3.2" + appraisal_name: "r3-set-1" + exec_cmd: "rake test" + gemfile: "Appraisal.root" rubygems: latest bundler: latest - gemfile: vanilla - #- Ruby 3.1 tests are run by coverage.yml + + # Ruby 3.3 + - ruby: "3.3" + appraisal_name: "r3" + exec_cmd: "rake test" + gemfile: "Appraisal.root" + rubygems: latest + bundler: latest + 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: true # runs 'bundle install' and caches installed gems automatically - - name: Run tests - run: bundle exec rake test + 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 main 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 }} diff --git a/.github/workflows/unsupported.yml b/.github/workflows/unsupported.yml index a33ec605..a53c98a9 100644 --- a/.github/workflows/unsupported.yml +++ b/.github/workflows/unsupported.yml @@ -1,4 +1,7 @@ -name: Unsupported (EOL) Ruby Matrix +name: MRI 2.7 (Unsupported) + +permissions: + contents: read env: K_SOUP_COV_DO: false @@ -7,6 +10,7 @@ on: push: branches: - 'main' + - "*-stable" tags: - '!*' # Do not execute on tags pull_request: @@ -23,33 +27,54 @@ concurrency: jobs: test: - name: Specs - 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 + name: Tests ${{ matrix.ruby }} ${{ matrix.appraisal_name }}${{ matrix.name_extra || '' }} + if: ${{ !contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]') }} + runs-on: ubuntu-22.04 + 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: include: - - ruby: "3.0" - rubygems: "3.3.27" - bundler: none - gemfile: vanilla + # Ruby 2.7 - ruby: "2.7" - rubygems: "3.3.27" - bundler: none - gemfile: vanilla - runs-on: ubuntu-24.04 - continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }} + appraisal_name: "r2" + exec_cmd: "rake test" + gemfile: "Appraisal.root" + rubygems: '3.4.22' + bundler: '2.4.22' + - ruby: "2.7" + appraisal_name: "r2-set-1" + exec_cmd: "rake test" + gemfile: "Appraisal.root" + rubygems: '3.4.22' + bundler: '2.4.22' + - ruby: "2.7" + appraisal_name: "r2-set-2" + exec_cmd: "rake test" + gemfile: "Appraisal.root" + rubygems: '3.4.22' + bundler: '2.4.22' + 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: true # runs 'bundle install' and caches installed gems automatically - - name: Run tests - run: bundle exec rake test + 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 main 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 }} diff --git a/.idea/GitLink.xml b/.idea/GitLink.xml new file mode 100644 index 00000000..009597cc --- /dev/null +++ b/.idea/GitLink.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..39693f09 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/ruby-openid2.iml b/.idea/ruby-openid2.iml new file mode 100644 index 00000000..ae715dc2 --- /dev/null +++ b/.idea/ruby-openid2.iml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 3f7d6dd0..dd5145b2 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -4,10 +4,13 @@