From 3260b0aaac084a9f41ff410cd2cd0d365a12d372 Mon Sep 17 00:00:00 2001 From: johnnyshields <27655+johnnyshields@users.noreply.github.com> Date: Wed, 10 Jul 2024 23:39:41 +0900 Subject: [PATCH] Fix TruffleRuby simplecov. Also move Rubocop into the core test.yml file. --- .github/workflows/rubocop.yml | 24 ------------------------ .github/workflows/test.yml | 20 +++++++++++++++++--- test/test_helper.rb | 23 ++++++++++------------- 3 files changed, 27 insertions(+), 40 deletions(-) delete mode 100644 .github/workflows/rubocop.yml diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml deleted file mode 100644 index 471e3fa5..00000000 --- a/.github/workflows/rubocop.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- -name: Rubocop - -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - env: - CI: true - TESTOPTS: '-v' - steps: - - uses: actions/checkout@v3 - - name: Set up Ruby 3.0 - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.0 - bundler-cache: true - - - name: Install dependencies - run: bundle install - - - name: Run RuboCop - run: bundle exec rubocop --parallel diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d2841899..16b6f2d9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,6 +3,23 @@ name: ruby-saml CI on: [push, pull_request] jobs: + rubocop: + runs-on: ubuntu-latest + env: + CI: true + TESTOPTS: '-v' + steps: + - uses: actions/checkout@v3 + - name: Set up Ruby 3.3 + uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.3 + bundler-cache: true + - name: Install dependencies + run: bundle install + - name: Run RuboCop + run: bundle exec rubocop --parallel + test: name: Unit test strategy: @@ -40,9 +57,6 @@ jobs: - name: Coveralls uses: coverallsapp/github-action@master - # 2023/03/07 - Simplecov is not working on TruffleRuby. - # TruffleRuby tests are otherwise passing. - if: ${{ matrix.ruby-version != 'truffleruby' }} with: github-token: ${{ secrets.github_token }} parallel: true diff --git a/test/test_helper.rb b/test/test_helper.rb index ef5dc344..60bce42a 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,16 +1,13 @@ -# 2023/03/07 - Simplecov is not working on TruffleRuby. -unless defined?(TruffleRuby) - require 'simplecov' - require 'simplecov-lcov' - SimpleCov::Formatter::LcovFormatter.config.report_with_single_file = true - SimpleCov::Formatter::LcovFormatter.config.output_directory = 'coverage' - SimpleCov::Formatter::LcovFormatter.config.lcov_file_name = 'lcov.info' - SimpleCov.formatter = SimpleCov::Formatter::LcovFormatter - SimpleCov.start do - add_filter "test/" - add_filter "vendor/" - add_filter "lib/ruby_saml/logging.rb" - end +require 'simplecov' +require 'simplecov-lcov' +SimpleCov::Formatter::LcovFormatter.config.report_with_single_file = true +SimpleCov::Formatter::LcovFormatter.config.output_directory = 'coverage' +SimpleCov::Formatter::LcovFormatter.config.lcov_file_name = 'lcov.info' +SimpleCov.formatter = SimpleCov::Formatter::LcovFormatter +SimpleCov.start do + add_filter "test/" + add_filter "vendor/" + add_filter "lib/ruby_saml/logging.rb" end require 'stringio'