From 21ba307bf7fed01f974ad2eb5206c9c9ac63eeeb Mon Sep 17 00:00:00 2001 From: Cirdes Date: Sun, 9 Jun 2024 13:06:54 -0300 Subject: [PATCH] Adding test to ci (#1) - Running the same targets from the Phlex project against Ruby versions "3.2", "3.3", and "head". - Removed an unused "require" from the Rakefile. - ActiveSupport is a dependency in phlex_ui.rb, so I had to explicitly add it to the gemspec to make it work. Maybe in the future, we can remove this dependency. --- .github/workflows/ci.yml | 41 ++++++++++++++++++++++++++++++++ .github/workflows/standardrb.yml | 21 ---------------- Gemfile.lock | 14 ++++++++++- Rakefile | 2 -- phlex_ui.gemspec | 1 + 5 files changed, 55 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/standardrb.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..911cbd5 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,41 @@ +name: CI + +on: + pull_request: + branches: + - "*" + push: + branches: + - main + +jobs: + standard: + name: StandardRB Check Action + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.3 + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + - run: bundle exec standardrb --format progress + tests: + strategy: + fail-fast: false + matrix: + os: ["ubuntu-latest"] + ruby-version: + - "3.2" + - "3.3" + - "head" + name: Running minitest + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + bundler-cache: false + + - run: bundle install + - run: bundle exec rake test diff --git a/.github/workflows/standardrb.yml b/.github/workflows/standardrb.yml deleted file mode 100644 index 24d6279..0000000 --- a/.github/workflows/standardrb.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: StandardRB - -on: - pull_request: - branches: - - "*" - push: - branches: - - main - -jobs: - standard: - name: StandardRB Check Action - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.2 - bundler-cache: true # runs 'bundle install' and caches installed gems automatically - - run: bundle exec standardrb --format progress diff --git a/Gemfile.lock b/Gemfile.lock index bf84580..ea29382 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,6 +2,7 @@ PATH remote: . specs: phlex_ui (0.1.9) + activesupport (~> 6.0) phlex (~> 1.10) rouge (~> 4.2.0) ruby-next (~> 1.0) @@ -10,8 +11,17 @@ PATH GEM remote: https://rubygems.org/ specs: + activesupport (6.1.7.8) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + zeitwerk (~> 2.3) ast (2.4.2) + concurrent-ruby (1.3.3) diff-lcs (1.5.1) + i18n (1.14.5) + concurrent-ruby (~> 1.0) json (2.7.2) language_server-protocol (3.17.0.3) lint_roller (1.1.0) @@ -67,6 +77,8 @@ GEM standard-performance (1.3.1) lint_roller (~> 1.1) rubocop-performance (~> 1.20.2) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) unicode-display_width (2.5.0) unparser (0.6.13) diff-lcs (~> 1.3) @@ -84,4 +96,4 @@ DEPENDENCIES standard BUNDLED WITH - 2.5.3 + 2.3.25 diff --git a/Rakefile b/Rakefile index cf6c688..835c591 100644 --- a/Rakefile +++ b/Rakefile @@ -1,7 +1,5 @@ # frozen_string_literal: true -require "bundler/gem_tasks" -require "standard/rake" require "minitest/test_task" Minitest::TestTask.create(:test) do |t| diff --git a/phlex_ui.gemspec b/phlex_ui.gemspec index 613b4e2..1459bbb 100644 --- a/phlex_ui.gemspec +++ b/phlex_ui.gemspec @@ -15,6 +15,7 @@ Gem::Specification.new do |s| s.add_dependency "phlex", "~> 1.10" s.add_dependency "rouge", "~> 4.2.0" s.add_dependency "zeitwerk", "~> 2.6" + s.add_dependency "activesupport", "~> 6.0" # When gem is installed from source, we add `ruby-next` as a dependency # to auto-transpile source files during the first load