Git Product home page Git Product logo

Comments (4)

MikeMcC399 avatar MikeMcC399 commented on September 7, 2024

The pnpm documentation recommends the following:

GitHub Actions

On GitHub Actions, you can use pnpm for installing and caching your dependencies
like so (belongs in .github/workflows/NAME.yml):

name: pnpm Example Workflow
on:
  push:

jobs:
  build:
    runs-on: ubuntu-22.04
    strategy:
      matrix:
        node-version: [20]
    steps:
    - uses: actions/checkout@v4
    - name: Install pnpm
      uses: pnpm/action-setup@v4
      with:
        version: 9
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v4
      with:
        node-version: ${{ matrix.node-version }}
        cache: 'pnpm'
    - name: Install dependencies
      run: pnpm install

It remains open how applicable the above recommendations are for use together with cypress-io/github-action.

from github-action.

MikeMcC399 avatar MikeMcC399 commented on September 7, 2024
  • The previous recommendation for pnpm caching came from an earlier recommendation of the pnpm documentation.

  • Testing again with the relevant commit 8c3db3a before caching was removed through PR #1188 shows that it sometimes works and sometimes does not work. When the example-basic-pnpm fails, the Linux workflows are affected, and there are 3 of them running in parallel. The failure mechanism is however not clear. Before the test all GitHub Action caches were cleared.

https://github.com/cypress-io/github-action/blob/8c3db3a4795a005ea7de1f04087c97a3b9ddda84/README.md#pnpm

name: example-basic-pnpm
on: push
jobs:
  basic-pnpm:
    runs-on: ubuntu-22.04
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Install pnpm
        run: npm install -g pnpm@9
      - name: Get pnpm store directory
        shell: bash
        run: |
          echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
      - name: Setup pnpm cache
        uses: actions/cache@v4
        with:
          path: ${{ env.STORE_PATH }}
          key: ${{ runner.os }}-pnpm-store-${{ hashFiles('examples/basic-pnpm/pnpm-lock.yaml') }}
      - name: Cypress run
        uses: cypress-io/github-action@v6
        with:
          working-directory: examples/basic-pnpm

from github-action.

MikeMcC399 avatar MikeMcC399 commented on September 7, 2024
  • PR #1228 resolves this issue as far as caching for pnpm in non-workspace setups is concerned.
  • Currently cypress-io/github-action does not inherently support pnpm workspaces. See enhancement request #1144. This leads to issues when attempting to apply the pnpm caching recommendations. I will follow this up with separate issue descriptions.

from github-action.

MikeMcC399 avatar MikeMcC399 commented on September 7, 2024

from github-action.

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.