Skip to content

Commit 84456e0

Browse files
Refactor CI packer version environment variable handling in workflows
1 parent c1d10b6 commit 84456e0

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

.github/workflows/examples.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ jobs:
9797
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
9898
- name: Set packer version environment variable
9999
run: |
100-
echo "CI_PACKER_VERSION=${{ matrix.versions == 'oldest' && 'old' || 'new' }}" >> $GITHUB_ENV
100+
echo "CI_PACKER_VERSION=${{ matrix.versions }}" >> $GITHUB_ENV
101101
- name: Main CI
102102
if: steps.changed-files.outputs.any_changed == 'true'
103103
run: bundle exec rake run_rspec:${{ matrix.versions == 'oldest' && 'web' || 'shaka' }}packer_examples

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ jobs:
192192
- run: cd spec/dummy && bundle info shakapacker
193193
- name: Set packer version environment variable
194194
run: |
195-
echo "CI_PACKER_VERSION=${{ matrix.versions == 'oldest' && 'old' || 'new' }}" >> $GITHUB_ENV
195+
echo "CI_PACKER_VERSION=${{ matrix.versions }}" >> $GITHUB_ENV
196196
- name: Main CI
197197
run: bundle exec rake run_rspec:all_dummy
198198
- name: Store test results

.github/workflows/rspec-package-specs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
git commit -am "stop generators from complaining about uncommitted code"
5050
- name: Set packer version environment variable
5151
run: |
52-
echo "CI_PACKER_VERSION=${{ matrix.versions == 'oldest' && 'old' || 'new' }}" >> $GITHUB_ENV
52+
echo "CI_PACKER_VERSION=${{ matrix.versions }}" >> $GITHUB_ENV
5353
- name: Run rspec tests
5454
run: bundle exec rspec spec/react_on_rails
5555
- name: Store test results

spec/dummy/spec/helpers/react_on_rails_helper_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class PlainReactOnRailsHelper
5151
allow(helper).to receive(:append_stylesheet_pack_tag)
5252
expect { helper.load_pack_for_generated_component("component_name", render_options) }.not_to raise_error
5353

54-
if ENV["CI_PACKER_VERSION"] == "old"
54+
if ENV["CI_PACKER_VERSION"] == "oldest"
5555
expect(helper).to have_received(:append_javascript_pack_tag).with("generated/component_name", { defer: false })
5656
else
5757
expect(helper).to have_received(:append_javascript_pack_tag)

spec/react_on_rails/utils_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ module ReactOnRails
1010
# If rspec tests are run locally, we want to test both packers.
1111
# If rspec tests are run in CI, we want to test the packer specified in the CI_PACKER_VERSION environment variable.
1212
# Check script/convert and .github/workflows/rspec-package-specs.yml for more details.
13-
packers_to_test = if ENV["CI_PACKER_VERSION"] == "old"
13+
packers_to_test = if ENV["CI_PACKER_VERSION"] == "oldest"
1414
["webpacker"]
15-
elsif ENV["CI_PACKER_VERSION"] == "new"
15+
elsif ENV["CI_PACKER_VERSION"] == "newest"
1616
["shakapacker"]
1717
else
1818
%w[shakapacker webpacker]

0 commit comments

Comments
 (0)