-
-
Notifications
You must be signed in to change notification settings - Fork 636
Fix yarn
/bundle install
in CI
#1735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
But I am awaiting their reply for what to do for multiple There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
- 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 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-data and https://github.com/actions/cache/blob/main/examples.md#node---npm for why this is preferred over caching
node_modules
. In our case it also avoids duplication betweennode_modules
andspec/dummy/node_modules
.