From 6b8eed282a511663ae10c2b6263ed4c8e4f498da Mon Sep 17 00:00:00 2001 From: HAHWUL Date: Thu, 26 Sep 2024 00:37:34 +0900 Subject: [PATCH 1/5] Add RSpec workflow for running tests on pull requests Signed-off-by: HAHWUL --- .github/workflows/rspec.yml | 16 ++++++++++++++++ Gemfile | 1 + Gemfile.lock | 15 +++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 .github/workflows/rspec.yml diff --git a/.github/workflows/rspec.yml b/.github/workflows/rspec.yml new file mode 100644 index 0000000..6be9379 --- /dev/null +++ b/.github/workflows/rspec.yml @@ -0,0 +1,16 @@ +name: RSpec +on: + pull_request: + +jobs: + rspec: + runs-on: ubuntu-latest + steps: + - name: Test + run: bundle exec rspec -f j -o tmp/rspec_results.json -f p + + - name: RSpec Report + uses: SonicGarden/rspec-report-action@v5 + with: + json-path: tmp/rspec_results.json + if: always() \ No newline at end of file diff --git a/Gemfile b/Gemfile index 1550546..9b1f311 100644 --- a/Gemfile +++ b/Gemfile @@ -8,3 +8,4 @@ gem 'open-uri', '>= 0.4.0' gem 'set' gem 'sitemap-parser' gem 'thor' +gem 'rspec' diff --git a/Gemfile.lock b/Gemfile.lock index 41c6a9c..d008cba 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -6,6 +6,7 @@ GEM concurrent-ruby-edge (0.7.1) concurrent-ruby (~> 1.3) date (3.3.4) + diff-lcs (1.5.1) ethon (0.16.0) ffi (>= 1.15.0) ffi (1.17.0-arm64-darwin) @@ -20,6 +21,19 @@ GEM time uri racc (1.8.1) + rspec (3.13.0) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.1) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.3) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-support (3.13.1) set (1.1.0) sitemap-parser (0.5.6) nokogiri (~> 1.6) @@ -43,6 +57,7 @@ DEPENDENCIES json nokogiri open-uri (>= 0.4.0) + rspec set sitemap-parser thor From 424b4ef10d31106e26a47d24aa2b52ced44e2a04 Mon Sep 17 00:00:00 2001 From: HAHWUL Date: Thu, 26 Sep 2024 00:38:19 +0900 Subject: [PATCH 2/5] Add support for dev branch in contributors workflow Signed-off-by: HAHWUL --- .github/workflows/contributors.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/contributors.yml b/.github/workflows/contributors.yml index 66fa3b7..25f1142 100644 --- a/.github/workflows/contributors.yml +++ b/.github/workflows/contributors.yml @@ -2,7 +2,7 @@ name: Contributors on: push: - branches: [main] + branches: [main, dev] workflow_dispatch: inputs: logLevel: From d1f174751b96eef22dde95583d8eacd3ba62253b Mon Sep 17 00:00:00 2001 From: HAHWUL Date: Thu, 26 Sep 2024 00:39:35 +0900 Subject: [PATCH 3/5] Refactor contributors workflow to only trigger on the main branch Signed-off-by: HAHWUL --- .github/workflows/contributors.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/contributors.yml b/.github/workflows/contributors.yml index 25f1142..66fa3b7 100644 --- a/.github/workflows/contributors.yml +++ b/.github/workflows/contributors.yml @@ -2,7 +2,7 @@ name: Contributors on: push: - branches: [main, dev] + branches: [main] workflow_dispatch: inputs: logLevel: From 572e932f23cf640af7f6704858837ce57a40dde3 Mon Sep 17 00:00:00 2001 From: HAHWUL Date: Thu, 26 Sep 2024 00:44:20 +0900 Subject: [PATCH 4/5] Refactor RSpec workflow to use Ruby 3.3 and cache installed gems Signed-off-by: HAHWUL --- .github/workflows/rspec.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rspec.yml b/.github/workflows/rspec.yml index 6be9379..17014be 100644 --- a/.github/workflows/rspec.yml +++ b/.github/workflows/rspec.yml @@ -1,16 +1,21 @@ +--- name: RSpec on: pull_request: - jobs: rspec: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 + - name: Set up Ruby 3.3 + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.3' # Not needed with a `.ruby-version` or `.tool-versions` + bundler-cache: true # runs 'bundle install' and caches installed gems automaticallyz - name: Test run: bundle exec rspec -f j -o tmp/rspec_results.json -f p - - name: RSpec Report uses: SonicGarden/rspec-report-action@v5 with: json-path: tmp/rspec_results.json - if: always() \ No newline at end of file + if: always() From f7def7bff3a4bffa3b73a68b4ac49daf18c82a47 Mon Sep 17 00:00:00 2001 From: HAHWUL Date: Thu, 26 Sep 2024 00:45:17 +0900 Subject: [PATCH 5/5] Refactor Gemfile.lock to add support for x86_64-linux platform Signed-off-by: HAHWUL --- Gemfile.lock | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Gemfile.lock b/Gemfile.lock index d008cba..8080308 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,11 +11,14 @@ GEM ffi (>= 1.15.0) ffi (1.17.0-arm64-darwin) ffi (1.17.0-x86_64-darwin) + ffi (1.17.0-x86_64-linux-gnu) json (2.7.2) nokogiri (1.16.7-arm64-darwin) racc (~> 1.4) nokogiri (1.16.7-x86_64-darwin) racc (~> 1.4) + nokogiri (1.16.7-x86_64-linux) + racc (~> 1.4) open-uri (0.4.1) stringio time @@ -50,6 +53,7 @@ PLATFORMS arm64-darwin-22 arm64-darwin-23 x86_64-darwin-21 + x86_64-linux DEPENDENCIES colorize