diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index caa488ac36..87ae7c118a 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -8,12 +8,13 @@ on: jobs: examples: - env: - SKIP_YARN_COREPACK_CHECK: 0 strategy: fail-fast: false matrix: versions: ['oldest', 'newest'] + env: + SKIP_YARN_COREPACK_CHECK: 0 + BUNDLE_FROZEN: ${{ matrix.versions == 'oldest' && 'false' || 'true' }} runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 @@ -45,6 +46,8 @@ jobs: uses: actions/setup-node@v4 with: node-version: 20 + cache: yarn + cache-dependency-path: '**/yarn.lock' - name: Print system information run: | echo "Linux release: "; cat /etc/issue @@ -57,21 +60,16 @@ jobs: - name: run conversion script to support shakapacker v6 if: matrix.versions == 'oldest' run: script/convert - - name: Save root node_modules to cache - uses: actions/cache@v4 - with: - path: node_modules - key: v5-package-node-modules-cache-${{ hashFiles('yarn.lock') }} - name: Save root ruby gems to cache uses: actions/cache@v4 with: path: vendor/bundle - key: package-app-gem-cache-${{ hashFiles('react_on_rails.gemspec') }}-${{ hashFiles('Gemfile.development_dependencies') }}-${{ matrix.versions }} + key: package-app-gem-cache-${{ hashFiles('Gemfile.lock') }}-${{ matrix.versions }} - id: get-sha run: echo "sha=\"$(git rev-parse HEAD)\"" >> "$GITHUB_OUTPUT" - name: Install Node modules with Yarn for renderer package run: | - yarn install --no-progress --no-emoji + yarn install --no-progress --no-emoji ${{ matrix.versions == 'newest' && '--frozen-lockfile' || '' }} sudo yarn global add yalc - name: yalc publish for react-on-rails run: yalc publish diff --git a/.github/workflows/lint-js-and-ruby.yml b/.github/workflows/lint-js-and-ruby.yml index 08b6fc1fd2..783c7e2d56 100644 --- a/.github/workflows/lint-js-and-ruby.yml +++ b/.github/workflows/lint-js-and-ruby.yml @@ -8,6 +8,8 @@ on: jobs: build: + env: + BUNDLE_FROZEN: true runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 @@ -22,6 +24,8 @@ jobs: uses: actions/setup-node@v4 with: node-version: 20 + cache: yarn + cache-dependency-path: '**/yarn.lock' - name: Print system information run: | echo "Linux release: "; cat /etc/issue @@ -31,42 +35,32 @@ jobs: echo "Node version: "; node -v echo "Yarn version: "; yarn --version echo "Bundler version: "; bundle --version - - name: Save root node_modules to cache - uses: actions/cache@v4 - with: - path: node_modules - key: v5-package-node-modules-cache-${{ hashFiles('yarn.lock') }} - name: Save root ruby gems to cache uses: actions/cache@v4 with: path: vendor/bundle - key: package-app-gem-cache-${{ hashFiles('react_on_rails.gemspec') }}-${{ hashFiles('Gemfile.development_dependencies') }}-oldest + key: package-app-gem-cache-${{ hashFiles('Gemfile.lock') }}-oldest - name: Install Node modules with Yarn for renderer package run: | - yarn install --no-progress --no-emoji + yarn install --no-progress --no-emoji --frozen-lockfile sudo yarn global add yalc - name: yalc publish for react-on-rails run: yalc publish - - name: Save spec/dummy/node_modules to cache - uses: actions/cache@v4 - with: - path: spec/dummy/node_modules - key: dummy-app-node-modules-cache-${{ hashFiles('spec/dummy/package.json') }}-newest - 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 --no-progress --no-emoji --frozen-lockfile - 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: Lint Ruby run: bundle exec rubocop - name: Install Node modules with Yarn for dummy app - run: cd spec/dummy && yarn install --ignore-scripts --no-progress --no-emoji + run: cd spec/dummy && yarn install --no-progress --no-emoji --frozen-lockfile - name: Save dummy app ruby gems to cache uses: actions/cache@v4 with: path: spec/dummy/vendor/bundle - key: dummy-app-gem-cache-${{ hashFiles('react_on_rails.gemspec') }}-${{ hashFiles('Gemfile.development_dependencies') }}-oldest + key: dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}-oldest - name: Install Ruby Gems for dummy app run: | cd spec/dummy diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 09d23d43c3..2d2ea3c5ed 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,6 +29,8 @@ jobs: uses: actions/setup-node@v4 with: node-version: ${{ matrix.versions == 'oldest' && '16' || '20' }} + cache: yarn + cache-dependency-path: '**/yarn.lock' - name: Print system information run: | echo "Linux release: "; cat /etc/issue @@ -41,31 +43,21 @@ jobs: - name: run conversion script to support shakapacker v6 if: matrix.versions == 'oldest' run: script/convert - - name: Save root node_modules to cache - uses: actions/cache@v4 - with: - path: node_modules - key: v5-package-node-modules-cache-${{ hashFiles('yarn.lock') }} - name: Install Node modules with Yarn for renderer package run: | - yarn install --no-progress --no-emoji + yarn install --no-progress --no-emoji ${{ matrix.versions == 'newest' && '--frozen-lockfile' || '' }} sudo yarn global add yalc - name: yalc publish for react-on-rails run: yalc publish - - name: Save spec/dummy/node_modules to cache - uses: actions/cache@v4 - with: - path: spec/dummy/node_modules - key: dummy-app-node-modules-cache-${{ hashFiles('spec/dummy/package.json') }}-${{ 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 --no-progress --no-emoji ${{ matrix.versions == 'newest' && '--frozen-lockfile' || '' }} - name: Save dummy app ruby gems to cache uses: actions/cache@v4 with: path: spec/dummy/vendor/bundle - key: dummy-app-gem-cache-${{ hashFiles('react_on_rails.gemspec') }}-${{ hashFiles('Gemfile.development_dependencies') }}-${{ matrix.versions }} + key: dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}-${{ matrix.versions }} - name: Install Ruby Gems for dummy app run: | cd spec/dummy @@ -105,6 +97,8 @@ jobs: uses: actions/setup-node@v4 with: node-version: ${{ matrix.versions == 'oldest' && '16' || '20' }} + cache: yarn + cache-dependency-path: '**/yarn.lock' - name: Print system information run: | echo "Linux release: "; cat /etc/issue @@ -117,26 +111,16 @@ jobs: - name: run conversion script to support shakapacker v6 if: matrix.versions == 'oldest' run: script/convert - - name: Save root node_modules to cache - uses: actions/cache@v4 - with: - path: node_modules - key: v5-package-node-modules-cache-${{ hashFiles('yarn.lock') }} - name: Save root ruby gems to cache uses: actions/cache@v4 with: path: vendor/bundle - key: package-app-gem-cache-${{ hashFiles('react_on_rails.gemspec') }}-${{ hashFiles('Gemfile.development_dependencies') }}-${{ matrix.versions }} + key: package-app-gem-cache-${{ hashFiles('Gemfile.lock') }}-${{ matrix.versions }} - name: Save dummy app ruby gems to cache uses: actions/cache@v4 with: path: spec/dummy/vendor/bundle - key: dummy-app-gem-cache-${{ hashFiles('react_on_rails.gemspec') }}-${{ hashFiles('Gemfile.development_dependencies') }}-${{ matrix.versions }} - - name: Save spec/dummy/node_modules to cache - uses: actions/cache@v4 - with: - path: spec/dummy/node_modules - key: dummy-app-node-modules-cache-${{ hashFiles('spec/dummy/package.json') }}-${{ matrix.versions }} + key: dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}-${{ matrix.versions }} - id: get-sha run: echo "sha=\"$(git rev-parse HEAD)\"" >> "$GITHUB_OUTPUT" - name: Save test Webpack bundles to cache (for build number checksum used by RSpec job) @@ -146,14 +130,14 @@ jobs: key: dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}-${{ matrix.versions }} - name: Install Node modules with Yarn run: | - yarn install --no-progress --no-emoji + yarn install --no-progress --no-emoji ${{ matrix.versions == 'newest' && '--frozen-lockfile' || '' }} sudo yarn global add yalc - name: yalc publish for react-on-rails run: yalc publish - 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 --no-progress --no-emoji ${{ matrix.versions == 'newest' && '--frozen-lockfile' || '' }} - name: Dummy JS tests run: | cd spec/dummy diff --git a/.github/workflows/package-js-tests.yml b/.github/workflows/package-js-tests.yml index 5ceeb922c0..d1a486b5d4 100644 --- a/.github/workflows/package-js-tests.yml +++ b/.github/workflows/package-js-tests.yml @@ -20,6 +20,8 @@ jobs: uses: actions/setup-node@v4 with: node-version: ${{ matrix.versions == 'oldest' && '16' || '20' }} + cache: yarn + cache-dependency-path: '**/yarn.lock' - name: Print system information run: | echo "Linux release: "; cat /etc/issue @@ -27,17 +29,12 @@ jobs: echo "Current directory: "; pwd echo "Node version: "; node -v echo "Yarn version: "; yarn --version - - name: Save root node_modules to cache - uses: actions/cache@v4 - with: - path: node_modules - key: v5-package-node-modules-cache-${{ hashFiles('yarn.lock') }} - name: run conversion script if: matrix.versions == 'oldest' run: script/convert - name: Install Node modules with Yarn for renderer package run: | - yarn install --no-progress --no-emoji + yarn install --no-progress --no-emoji ${{ matrix.versions == 'newest' && '--frozen-lockfile' || '' }} sudo yarn global add yalc - name: Run JS unit tests for Renderer package run: yarn test diff --git a/.github/workflows/rspec-package-specs.yml b/.github/workflows/rspec-package-specs.yml index 67010526d0..9879adf74b 100644 --- a/.github/workflows/rspec-package-specs.yml +++ b/.github/workflows/rspec-package-specs.yml @@ -12,6 +12,8 @@ jobs: fail-fast: false matrix: versions: ['oldest', 'newest'] + env: + BUNDLE_FROZEN: ${{ matrix.versions == 'oldest' && 'false' || 'true' }} runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 @@ -38,7 +40,7 @@ jobs: uses: actions/cache@v4 with: path: vendor/bundle - key: package-app-gem-cache-${{ hashFiles('react_on_rails.gemspec') }}-${{ matrix.versions }} + key: package-app-gem-cache-${{ hashFiles('Gemfile.lock') }}-${{ matrix.versions }} - 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: Git Stuff