Skip to content

Commit

Permalink
still wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Judahmeek committed Jun 14, 2024
1 parent b878c60 commit f14bbf6
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 91 deletions.
29 changes: 15 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,29 @@ jobs:
build-dummy-app-webpack-test-bundles:
strategy:
matrix:
versions: ['oldest_versions', 'newest_versions']
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/shakapacker_${{ matrix.versions == 'oldest_versions' && '6' || '8' }}.gemfile
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.versions == 'oldest_versions' && '3.0' || '3.3' }}
ruby-version: ${{ matrix.versions == 'shakapacker_v6' && '3.0' || '3.3' }}
bundler: 2.5.9
# libyaml-dev is needed for psych v5
# this gem depends on sdoc which depends on rdoc which depends on psych
- run: gem install appraisal
- name: Fix dependency for libyaml-dev
run: sudo apt install libyaml-dev
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.versions == 'oldest_versions' && '16' || '20' }}
node-version: ${{ matrix.versions == 'shakapacker_v6' && '16' || '20' }}
- name: Print system information
run: |
echo "Linux release: "; cat /etc/issue
Expand All @@ -57,22 +58,23 @@ jobs:
uses: actions/cache@v3
with:
path: spec/dummy/node_modules
key: v5-dummy-app-node-modules-cache-${{ hashFiles('spec/dummy/yarn.lock') }}
key: v5-dummy-app-node-modules-cache-${{ hashFiles('spec/dummy/yarn.lock') }}-${{ matrix.versions }}
- name: yalc add react-on-rails
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' }}"
- name: Save dummy app ruby gems to cache
uses: actions/cache@v3
with:
path: spec/dummy/vendor/bundle
key: v5-dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}
key: dummy-app-gem-cache-${{ hashFiles(format('{0}/gemfiles/{1}.gemfile.lock', github.workspace, matrix.versions)) }}
- name: Install Ruby Gems for dummy app
run: cd spec/dummy && 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: generate file system-based packs
run: cd spec/dummy && RAILS_ENV=test bundle exec rake react_on_rails:generate_packs
- name: Build test bundles for dummy app
run: cd spec/dummy && yarn run build:test
run: cd spec/dummy && rm -rf public/webpack/test && yarn build:rescript && RAILS_ENV=test NODE_ENV=test bin/${{ matrix.versions == 'shakapacker_v6' && 'web' || 'shaka' }}packer
- id: get-sha
run: echo "::set-output name=sha::$(git rev-parse HEAD)"
- name: Save test webpack bundles to cache (for build number checksum used by rspec job)
Expand All @@ -85,24 +87,24 @@ jobs:
needs: build-dummy-app-webpack-test-bundles
strategy:
matrix:
versions: ['oldest_versions', 'newest_versions']
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/shakapacker_${{ matrix.versions == 'oldest_versions' && '6' || '8' }}.gemfile
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.versions == 'oldest_versions' && '3.0' || '3.3' }}
ruby-version: ${{ matrix.versions == 'shakapacker_v6' && '3.0' || '3.3' }}
bundler: 2.5.9
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.versions == 'oldest_versions' && '16' || '20' }}
node-version: ${{ matrix.versions == 'shakapacker_v6' && '16' || '20' }}
- name: Print system information
run: |
echo "Linux release: "; cat /etc/issue
Expand All @@ -126,12 +128,12 @@ jobs:
uses: actions/cache@v3
with:
path: spec/dummy/vendor/bundle
key: v5-dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}
key: dummy-app-gem-cache-${{ hashFiles(format('{0}/gemfiles/{1}.gemfile.lock', github.workspace, matrix.versions)) }}
- name: Save spec/dummy/node_modules to cache
uses: actions/cache@v3
with:
path: spec/dummy/node_modules
key: v5-dummy-app-node-modules-cache-${{ hashFiles('spec/dummy/yarn.lock') }}
key: v5-dummy-app-node-modules-cache-${{ hashFiles('spec/dummy/yarn.lock') }}-${{ matrix.versions }}
- id: get-sha
run: echo "::set-output name=sha::$(git rev-parse HEAD)"
- name: Save test webpack bundles to cache (for build number checksum used by rspec job)
Expand All @@ -142,7 +144,6 @@ 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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rspec-package-specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ jobs:
strategy:
matrix:
ruby: [3.0, 3.3]
node: [16, 20]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand All @@ -36,6 +35,7 @@ jobs:
with:
path: vendor/bundle
key: v5-package-app-gem-cache-${{ hashFiles('react_on_rails.gemspec') }}
- 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: Run rspec tests
Expand Down
21 changes: 8 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,17 +132,6 @@ yarn
yarn build
```

Or run this which builds the yarn package, then the webpack files for spec/dummy, and runs tests in
spec/dummy.


```sh
# Optionally change default selenium_firefox driver
export DRIVER=selenium_firefox
cd react_on_rails/
yarn run dummy:spec
```

### Run NPM JS tests

```sh
Expand All @@ -153,11 +142,17 @@ yarn test
### Run spec/dummy tests

```sh
cd react_on_rails/spec/dummy
cd react_on_rails
npm -g i yalc
bundle && yarn
yalc publish
cd spec/dummy
bundle && yarn
yarn add shakapacker
rspec
```

### Run most tests and linting
### Run package tests and linting

```sh
cd react_on_rails/
Expand Down
4 changes: 2 additions & 2 deletions appraisals
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
appraise 'shakapacker_6' do
appraise 'shakapacker_v6' do
gem 'shakapacker', '~> 6.6.0'
end

appraise 'shakapacker_8' do
appraise 'shakapacker_v8' do
gem 'shakapacker', '~> 8.0.0'
end
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@
"prerelease": "yarn run check && yarn run clean && yarn run build",
"release:patch": "node_package/scripts/release patch",
"release:minor": "node_package/scripts/release minor",
"release:major": "node_package/scripts/release major",
"dummy:install": "rake dummy_apps",
"dummy:spec": "rake run_rspec:dummy"
"release:major": "node_package/scripts/release major"
},
"repository": {
"type": "git",
Expand Down
30 changes: 0 additions & 30 deletions rakelib/dummy_apps.rake

This file was deleted.

4 changes: 2 additions & 2 deletions rakelib/run_rspec.rake
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ namespace :run_rspec do
end

desc "Runs dummy rspec with turbolinks"
task dummy: ["dummy_apps:dummy_app"] do
task :dummy do
run_tests_in(spec_dummy_dir)
end

desc "Runs dummy rspec without turbolinks"
task dummy_no_turbolinks: ["dummy_apps:dummy_app"] do
task :dummy_no_turbolinks do
run_tests_in(spec_dummy_dir,
env_vars: "DISABLE_TURBOLINKS=TRUE",
command_name: "dummy_no_turbolinks")
Expand Down
1 change: 0 additions & 1 deletion spec/dummy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
"sass": "^1.43.4",
"sass-loader": "^12.3.0",
"sass-resources-loader": "^2.1.0",
"shakapacker": "8.0.0",
"style-loader": "^3.3.1",
"terser-webpack-plugin": "5.3.1",
"url-loader": "^4.0.0",
Expand Down
25 changes: 0 additions & 25 deletions spec/dummy/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2657,11 +2657,6 @@ argparse@^1.0.7:
dependencies:
sprintf-js "~1.0.2"

argparse@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==

arity-n@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/arity-n/-/arity-n-1.0.4.tgz#d9e76b11733e08569c0847ae7b39b2860b30b745"
Expand Down Expand Up @@ -5051,13 +5046,6 @@ js-yaml@^3.9.0:
argparse "^1.0.7"
esprima "^4.0.0"

js-yaml@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602"
integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==
dependencies:
argparse "^2.0.1"

jsesc@^2.5.1:
version "2.5.2"
resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4"
Expand Down Expand Up @@ -5881,11 +5869,6 @@ [email protected]:
resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.1.tgz#e6c4ddd7ed3aa27c68a20cc4e50e1a4ee83bbc4a"
integrity sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==

path-complete-extname@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/path-complete-extname/-/path-complete-extname-1.0.0.tgz#f889985dc91000c815515c0bfed06c5acda0752b"
integrity sha512-CVjiWcMRdGU8ubs08YQVzhutOR5DEfO97ipRIlOGMK5Bek5nQySknBpuxVAVJ36hseTNs+vdIcv57ZrWxH7zvg==

path-dirname@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0"
Expand Down Expand Up @@ -7029,14 +7012,6 @@ sha.js@^2.4.0, sha.js@^2.4.8:
inherits "^2.0.1"
safe-buffer "^5.0.1"

[email protected]:
version "8.0.0"
resolved "https://registry.yarnpkg.com/shakapacker/-/shakapacker-8.0.0.tgz#f29537c19078af7318758c92e7a1bca4cee96bdd"
integrity sha512-HCdpITzIKXzGEyUWQhKzPbpwwOsgTamaPH+0kXdhM59VQxZ3NWnT5cL3DlJdAT3sGsWCJskEl3eMkQlnh9DjhA==
dependencies:
js-yaml "^4.1.0"
path-complete-extname "^1.0.0"

shallow-clone@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3"
Expand Down

0 comments on commit f14bbf6

Please sign in to comment.