Skip to content

Commit

Permalink
fix: remove bahmutov/npm-install to fix windows builds
Browse files Browse the repository at this point in the history
We already use `actions/setup-node@v3` which has equivalent caching
functionality that isn't broken for yarn+windows (or yarn 2+ across the
board). So just use that wherever possible. In addition to fixing builds,
this has the added benefit of slightly speeding them up, since we won't
double-cache things (in some cases we had both caches enabled).

Making this PR against `main` instead `dev`, since the jobs explicitly
use `remix-run/remix/.github/workflows/reusable-test.yml@main`, but I can
switch it up if y'all like. Just trying to get my 4-month-old PR unblocked
yet again πŸ˜†πŸ˜­

For context, see bahmutov/npm-install#146, in
particular [this comment](bahmutov/npm-install#146 (comment)) and linked test output.

This is an alternative to remix-run#3587 or otherwise waiting for `bahmutov/npm-install`
to get fixed.
  • Loading branch information
jenseng committed Jun 28, 2022
1 parent e7becce commit d11b037
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 69 deletions.
56 changes: 28 additions & 28 deletions .github/workflows/deployments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: npm
cache-dependency-path: ./scripts/deployment-test/package.json # no lockfile, key caching off package.json

# some deployment targets require the latest version of npm
# TODO: remove this eventually when the default version we get
Expand All @@ -53,10 +55,8 @@ jobs:
working-directory: ./scripts/deployment-test

- name: πŸ“₯ Install deployment-test deps
uses: bahmutov/npm-install@v1
with:
working-directory: ./scripts/deployment-test
useLockFile: false
run: npm install
working-directory: ./scripts/deployment-test

- name: πŸš€ Deploy to Arc
run: node ./arc.mjs
Expand All @@ -81,6 +81,8 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: npm
cache-dependency-path: ./scripts/deployment-test/package.json # no lockfile, key caching off package.json

# some deployment targets require the latest version of npm
# TODO: remove this eventually when the default version we get
Expand All @@ -90,10 +92,8 @@ jobs:
working-directory: ./scripts/deployment-test

- name: πŸ“₯ Install deployment-test deps
uses: bahmutov/npm-install@v1
with:
working-directory: ./scripts/deployment-test
useLockFile: false
run: npm install
working-directory: ./scripts/deployment-test

- name: πŸš€ Deploy to Cloudflare Pages
run: node ./cf-pages.mjs
Expand All @@ -119,6 +119,8 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: npm
cache-dependency-path: ./scripts/deployment-test/package.json # no lockfile, key caching off package.json

# some deployment targets require the latest version of npm
# TODO: remove this eventually when the default version we get
Expand All @@ -128,10 +130,8 @@ jobs:
working-directory: ./scripts/deployment-test

- name: πŸ“₯ Install deployment-test deps
uses: bahmutov/npm-install@v1
with:
working-directory: ./scripts/deployment-test
useLockFile: false
run: npm install
working-directory: ./scripts/deployment-test

- name: πŸš€ Deploy to Cloudflare Workers
run: node ./cf-workers.mjs
Expand All @@ -156,6 +156,8 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: npm
cache-dependency-path: ./scripts/deployment-test/package.json # no lockfile, key caching off package.json

# some deployment targets require the latest version of npm
# TODO: remove this eventually when the default version we get
Expand All @@ -165,10 +167,8 @@ jobs:
working-directory: ./scripts/deployment-test

- name: πŸ“₯ Install deployment-test deps
uses: bahmutov/npm-install@v1
with:
working-directory: ./scripts/deployment-test
useLockFile: false
run: npm install
working-directory: ./scripts/deployment-test

- name: πŸ¦• Install Deno
uses: denoland/setup-deno@v1
Expand Down Expand Up @@ -198,6 +198,8 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: npm
cache-dependency-path: ./scripts/deployment-test/package.json # no lockfile, key caching off package.json

# some deployment targets require the latest version of npm
# TODO: remove this eventually when the default version we get
Expand All @@ -207,10 +209,8 @@ jobs:
working-directory: ./scripts/deployment-test

- name: πŸ“₯ Install deployment-test deps
uses: bahmutov/npm-install@v1
with:
working-directory: ./scripts/deployment-test
useLockFile: false
run: npm install
working-directory: ./scripts/deployment-test

- name: 🎈 Install the Fly CLI
run: curl -L https://fly.io/install.sh | FLYCTL_INSTALL=/usr/local sh
Expand All @@ -236,6 +236,8 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: npm
cache-dependency-path: ./scripts/deployment-test/package.json # no lockfile, key caching off package.json

# some deployment targets require the latest version of npm
# TODO: remove this eventually when the default version we get
Expand All @@ -245,10 +247,8 @@ jobs:
working-directory: ./scripts/deployment-test

- name: πŸ“₯ Install deployment-test deps
uses: bahmutov/npm-install@v1
with:
working-directory: ./scripts/deployment-test
useLockFile: false
run: npm install
working-directory: ./scripts/deployment-test

- name: πŸš€ Deploy to Netlify
run: node ./netlify.mjs
Expand All @@ -271,6 +271,8 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: npm
cache-dependency-path: ./scripts/deployment-test/package.json # no lockfile, key caching off package.json

# some deployment targets require the latest version of npm
# TODO: remove this eventually when the default version we get
Expand All @@ -280,10 +282,8 @@ jobs:
working-directory: ./scripts/deployment-test

- name: πŸ“₯ Install deployment-test deps
uses: bahmutov/npm-install@v1
with:
working-directory: ./scripts/deployment-test
useLockFile: false
run: npm install
working-directory: ./scripts/deployment-test

- name: πŸš€ Deploy to Vercel
run: node ./vercel.mjs
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ jobs:
cache: "yarn"

- name: πŸ“₯ Install deps
# even though this is called "npm-install" it does use yarn to install
# because we have a yarn.lock and caches efficiently.
uses: bahmutov/npm-install@v1
run: yarn --frozen-lockfile

- name: πŸ”— Convert Docs links to references
run: node scripts/markdown-references.mjs
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ jobs:
cache: "yarn"

- name: πŸ“₯ Install deps
# even though this is called "npm-install" it does use yarn to install
# because we have a yarn.lock and caches efficiently.
uses: bahmutov/npm-install@v1
run: yarn --frozen-lockfile

- name: ‴️ Update Version if needed
id: version
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/release-comments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: "yarn"
cache: "npm"
cache-dependency-path: scripts/release/package-lock.json

- name: πŸ“₯ Install deps
# even though this is called "npm-install" it does use yarn to install
# because we have a yarn.lock and caches efficiently.
uses: bahmutov/npm-install@v1
with:
working-directory: ./scripts/release
run: npm ci
working-directory: ./scripts/release

- name: πŸ“ Comment on issues
working-directory: ./scripts/release
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/release-private.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ jobs:
cache: "yarn"

- name: πŸ“₯ Install deps
# even though this is called "npm-install" it does use yarn to install
# because we have a yarn.lock and caches efficiently.
uses: bahmutov/npm-install@v1
run: yarn --frozen-lockfile

- name: πŸ— Build
run: yarn build
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ jobs:
cache: "yarn"

- name: πŸ“₯ Install deps
# even though this is called "npm-install" it does use yarn to install
# because we have a yarn.lock and caches efficiently.
uses: bahmutov/npm-install@v1
run: yarn --frozen-lockfile

- name: πŸ— Build
run: yarn build
Expand Down
16 changes: 4 additions & 12 deletions .github/workflows/reusable-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ jobs:
cache: "yarn"

- name: πŸ“₯ Install deps
# even though this is called "npm-install" it does use yarn to install
# because we have a yarn.lock and caches efficiently.
uses: bahmutov/npm-install@v1
run: yarn --frozen-lockfile

- name: πŸ— Build
run: yarn build
Expand All @@ -51,9 +49,7 @@ jobs:
cache: "yarn"

- name: πŸ“₯ Install deps
# even though this is called "npm-install" it does use yarn to install
# because we have a yarn.lock and caches efficiently.
uses: bahmutov/npm-install@v1
run: yarn --frozen-lockfile

- name: πŸ”¬ Lint
run: yarn lint
Expand Down Expand Up @@ -91,9 +87,7 @@ jobs:
cache: "yarn"

- name: πŸ“₯ Install deps
# even though this is called "npm-install" it does use yarn to install
# because we have a yarn.lock and caches efficiently.
uses: bahmutov/npm-install@v1
run: yarn --frozen-lockfile

- name: πŸ§ͺ Run Primary Tests
run: "yarn test:primary"
Expand Down Expand Up @@ -131,9 +125,7 @@ jobs:
cache: "yarn"

- name: πŸ“₯ Install deps
# even though this is called "npm-install" it does use yarn to install
# because we have a yarn.lock and caches efficiently.
uses: bahmutov/npm-install@v1
run: yarn --frozen-lockfile

# playwright recommends if you cache the binaries to keep it tied to the version of playwright you are using.
# https://playwright.dev/docs/ci#caching-browsers
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/stacks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ jobs:
run: |
npx -y create-remix@${{ inputs.version }} ${{ matrix.stack.name }} --template ${{ matrix.stack.repo }} --typescript --no-install
- name: πŸ“₯ Download deps
uses: bahmutov/npm-install@v1
- name: πŸ“₯ Install deps
uses: bahmutov/npm-install@v1 # more fine grained control than actions/setup-node@v3 caching, i.e. package.json doesn't exist until after the create-remix step
with:
working-directory: ${{ matrix.stack.name }}
useLockFile: false
Expand Down Expand Up @@ -90,8 +90,8 @@ jobs:
- name: πŸ“ Unzip artifact
run: unzip ${{ matrix.stack.name }}.zip

- name: πŸ“₯ Download deps
uses: bahmutov/npm-install@v1
- name: πŸ“₯ Install deps
uses: bahmutov/npm-install@v1 # more fine grained control than actions/setup-node@v3 caching, i.e. package.json doesn't exist until after the unzip step
with:
working-directory: ${{ matrix.stack.name }}

Expand Down Expand Up @@ -131,8 +131,8 @@ jobs:
- name: πŸ“ Unzip artifact
run: unzip ${{ matrix.stack.name }}.zip

- name: πŸ“₯ Download deps
uses: bahmutov/npm-install@v1
- name: πŸ“₯ Install deps
uses: bahmutov/npm-install@v1 # more fine grained control than actions/setup-node@v3 caching, i.e. package.json doesn't exist until after the unzip step
with:
working-directory: ${{ matrix.stack.name }}

Expand Down Expand Up @@ -172,8 +172,8 @@ jobs:
- name: πŸ“ Unzip artifact
run: unzip ${{ matrix.stack.name }}.zip

- name: πŸ“₯ Download deps
uses: bahmutov/npm-install@v1
- name: πŸ“₯ Install deps
uses: bahmutov/npm-install@v1 # more fine grained control than actions/setup-node@v3 caching, i.e. package.json doesn't exist until after the unzip step
with:
working-directory: ${{ matrix.stack.name }}

Expand Down Expand Up @@ -216,8 +216,8 @@ jobs:
- name: πŸ“ Unzip artifact
run: unzip ${{ matrix.stack.name }}.zip

- name: πŸ“₯ Download deps
uses: bahmutov/npm-install@v1
- name: πŸ“₯ Install deps
uses: bahmutov/npm-install@v1 # more fine grained control than actions/setup-node@v3 caching, i.e. package.json doesn't exist until after the unzip step
with:
working-directory: ${{ matrix.stack.name }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ on:
jobs:
test:
if: github.repository == 'remix-run/remix'
uses: remix-run/remix/.github/workflows/reusable-test.yml@main
uses: jenseng/remix/.github/workflows/reusable-test.yml@fix-yarn-caching
with:
node_version: '["latest"]'

0 comments on commit d11b037

Please sign in to comment.