diff --git a/.envrc b/.envrc index c7c12683..32639a4c 100644 --- a/.envrc +++ b/.envrc @@ -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, diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 4b7116e8..3eb520e5 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -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: @@ -19,9 +27,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. @@ -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 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 @@ -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/CodeCoverageSummary@v1.3.0 - if: ${{ github.event_name == 'pull_request' }} with: filename: ./coverage/coverage.xml badge: true @@ -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 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/git_toolbox_prj.xml b/.idea/git_toolbox_prj.xml deleted file mode 100644 index 02b915b8..00000000 --- a/.idea/git_toolbox_prj.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - \ 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..395c3d5d 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -4,10 +4,77 @@