Git Product home page Git Product logo

Comments (4)

nicolassanmar avatar nicolassanmar commented on September 22, 2024

I'm also curious about this. When run manually, we can also cache node_modules which leads to faster results, but regarding the pnpm store both solutions might be equal.

See my comparison of the two runs (one caching node_modules and the other not) here: #76 (comment)

from action-setup.

codeflorist avatar codeflorist commented on September 22, 2024

https://pnpm.io/continuous-integration#github-actions uses the cache: 'pnpm' version. imho the readme of this package and the website should use identical examples.

from action-setup.

mmkal avatar mmkal commented on September 22, 2024

Is there any reason the action couldn't automatically set up node and caching for users? It would be great if we could do something like:

on: [push]
jobs:
  test:
    steps:
      - uses: pnpm/action-setup@vnext
        with:
          do-for-me: node,cache,install
      - run: pnpm-test

People who wanted fine-grained control could just opt out of do-for-me and run separate uses: actions/setup-node, uses: actions/cache and run: pnpm install themselves. But getting started and being confident you're doing things a recommended/supported way would become very easy.

I think the equivalent of the above right now is something like this according to this repo's docs:

on: [push]
jobs:
  cache-and-install:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Install Node.js
        uses: actions/setup-node@v3
        with:
          node-version: 16

      - uses: pnpm/action-setup@v2
        name: Install pnpm
        with:
          version: 7
          run_install: false

      - name: Get pnpm store directory
        shell: bash
        run: |
          echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

      - uses: actions/cache@v3
        name: Setup pnpm cache
        with:
          path: ${{ env.STORE_PATH }}
          key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
          restore-keys: |
            ${{ runner.os }}-pnpm-store-

      - name: Install dependencies
        run: pnpm install

      - run: pnpm test

from action-setup.

FFdhorkin avatar FFdhorkin commented on September 22, 2024

@mmkal I believe that would be covered under #80

from action-setup.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.