Skip to content

Commit

Permalink
getting there?
Browse files Browse the repository at this point in the history
  • Loading branch information
Judahmeek committed Jun 14, 2024
1 parent f14bbf6 commit 6d410fd
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ jobs:
- name: Install Node modules with Yarn for renderer package
run: |
yarn install --no-progress --no-emoji
yarn run eslint -v
sudo yarn global add yalc
- name: yalc publish for react-on-rails
run: yalc publish
- run: gem install appraisal
- name: Install Ruby Gems for package
run: bundle lock --add-platform 'x86_64-linux' && bundle check --path=vendor/bundle || bundle _2.5.9_ install --path=vendor/bundle --jobs=4 --retry=3
- name: Ensure minimum required Chrome version
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/lint-js-and-ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ jobs:
- name: Install Node modules with Yarn for renderer package
run: |
yarn install --no-progress --no-emoji
yarn run eslint -v
sudo yarn global add yalc
- run: gem install appraisal
- name: Install Ruby Gems for package
run: bundle check --path=vendor/bundle || bundle _2.5.9_ install --path=vendor/bundle --jobs=4 --retry=3
- name: Linting of Ruby
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
run: cd spec/dummy && yalc add react-on-rails
- name: Install Node modules with Yarn for dummy app
run: cd spec/dummy && yarn install --no-progress --no-emoji
- run: cd spec/dummy && yarn install "shakapacker@${{ matrix.versions == 'shakapacker_v6' && '6.6.0' || '8.0.0' }}"
- run: cd spec/dummy && yarn add "shakapacker@${{ matrix.versions == 'shakapacker_v6' && '6.6.0' || '8.0.0' }}"
- name: Save dummy app ruby gems to cache
uses: actions/cache@v3
with:
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/rspec-package-specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,22 @@ on:
pull_request:

jobs:
build:
rspec-package-tests:
strategy:
matrix:
ruby: [3.0, 3.3]
versions: ['shakapacker_v6', 'shakapacker_v8']
runs-on: ubuntu-22.04
env:
# $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.versions }}.gemfile
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
ruby-version: ${{ matrix.versions == 'shakapacker_v6' && '3.0' || '3.3' }}
bundler: 2.5.9
- name: Print system information
run: |
Expand All @@ -34,7 +37,7 @@ jobs:
uses: actions/cache@v3
with:
path: vendor/bundle
key: v5-package-app-gem-cache-${{ hashFiles('react_on_rails.gemspec') }}
key: package-app-gem-cache-${{ hashFiles(format('{0}/gemfiles/{1}.gemfile.lock', github.workspace, matrix.versions)) }}
- run: gem install appraisal
- name: Install Ruby Gems for package
run: bundle check --path=vendor/bundle || bundle _2.5.9_ install --path=vendor/bundle --jobs=4 --retry=3
Expand Down
18 changes: 9 additions & 9 deletions spec/react_on_rails/configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module ReactOnRails

before do
allow(Rails).to receive(:root).and_return(File.expand_path("."))
allow(Shakapacker).to receive_message_chain("config.public_output_path")
allow(ReactOnRails::PackerUtils).to receive_message_chain("packer.config.public_output_path")
.and_return(packer_public_output_path)
end

Expand Down Expand Up @@ -83,7 +83,7 @@ module ReactOnRails
end

it "fails when \"shakapacker_precompile\" is truly and \"build_production_command\" is truly" do
allow(Shakapacker).to receive_message_chain("config.shakapacker_precompile?")
allow(ReactOnRails::PackerUtils).to receive_message_chain("packer.config.shakapacker_precompile?")
.and_return(true)
expect do
ReactOnRails.configure do |config|
Expand All @@ -93,7 +93,7 @@ module ReactOnRails
end

it "doesn't fail when \"shakapacker_precompile\" is falsy and \"build_production_command\" is truly" do
allow(Shakapacker).to receive_message_chain("config.shakapacker_precompile?")
allow(ReactOnRails::PackerUtils).to receive_message_chain("packer.config.shakapacker_precompile?")
.and_return(false)
expect do
ReactOnRails.configure do |config|
Expand All @@ -103,15 +103,15 @@ module ReactOnRails
end

it "doesn't fail when \"shakapacker_precompile\" is truly and \"build_production_command\" is falsy" do
allow(Shakapacker).to receive_message_chain("config.shakapacker_precompile?")
allow(ReactOnRails::PackerUtils).to receive_message_chain("packer.config.shakapacker_precompile?")
.and_return(true)
expect do
ReactOnRails.configure {} # rubocop:disable-line Lint/EmptyBlock
end.not_to raise_error
end

it "doesn't fail when \"shakapacker_precompile\" is falsy and \"build_production_command\" is falsy" do
allow(Shakapacker).to receive_message_chain("config.shakapacker_precompile?")
allow(ReactOnRails::PackerUtils).to receive_message_chain("packer.config.shakapacker_precompile?")
.and_return(false)
expect do
ReactOnRails.configure {} # rubocop:disable-line Lint/EmptyBlock
Expand All @@ -127,7 +127,7 @@ module ReactOnRails
end

it "fails when \"shakapacker_precompile\" is truly and \"build_production_command\" is truly" do
allow(Shakapacker).to receive_message_chain("config.shakapacker_precompile?")
allow(ReactOnRails::PackerUtils).to receive_message_chain("packer.config.shakapacker_precompile?")
.and_return(true)
expect do
ReactOnRails.configure do |config|
Expand All @@ -137,7 +137,7 @@ module ReactOnRails
end

it "doesn't fail when \"shakapacker_precompile\" is falsy and \"build_production_command\" is truly" do
allow(Shakapacker).to receive_message_chain("config.shakapacker_precompile?")
allow(ReactOnRails::PackerUtils).to receive_message_chain("packer.config.shakapacker_precompile?")
.and_return(false)
expect do
ReactOnRails.configure do |config|
Expand All @@ -147,15 +147,15 @@ module ReactOnRails
end

it "doesn't fail when \"shakapacker_precompile\" is truly and \"build_production_command\" is falsy" do
allow(Shakapacker).to receive_message_chain("config.shakapacker_precompile?")
allow(ReactOnRails::PackerUtils).to receive_message_chain("packer.config.shakapacker_precompile?")
.and_return(true)
expect do
ReactOnRails.configure {} # rubocop:disable-line Lint/EmptyBlock
end.not_to raise_error
end

it "doesn't fail when \"shakapacker_precompile\" is falsy and \"build_production_command\" is falsy" do
allow(Shakapacker).to receive_message_chain("config.shakapacker_precompile?")
allow(ReactOnRails::PackerUtils).to receive_message_chain("packer.config.shakapacker_precompile?")
.and_return(false)
expect do
ReactOnRails.configure {} # rubocop:disable-line Lint/EmptyBlock
Expand Down

0 comments on commit 6d410fd

Please sign in to comment.