Comments (4)
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.
-
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.
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.
- 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.
-
I successfully verified a test version of the workflow .github/workflows/example-start-and-pnpm-workspaces.yml modified to run mixed older Cypress versions and using
actions/setup-node
for pnpm caching. For the moment I will not update the production version of the workflow .github/workflows/example-start-and-pnpm-workspaces.yml to use caching. It is still a valid example without caching. -
On first run of .github/workflows/example-start-and-pnpm-workspaces.yml
cypress-io/github-action
attempts to verify the installation of Cypress usingnpx cypress verify
. Since there is no Cypress installed in the root of the workspace it downloads the latest version of Cypress, which is then cached in the npm cache for subsequent runs. This issue is similar to #971. -
PR #1228 already added pnpm caching to .github/workflows/example-basic-pnpm.yml and updated the README > pnpm section to describe pnpm caching. So, I'm now closing this issue as resolved.
from github-action.
Related Issues (20)
- Add thread_ts as an optional parameter to use threads as part of the cypress cloud slack integration HOT 4
- Cypress run starts but does not run any tests HOT 9
- Cypress.env returns undefined [Github Actions] HOT 11
- Cypress fails to connect to devTools after first test HOT 13
- `project` not working HOT 5
- adding user 1001 throws EACCES permission issue HOT 17
- Sporadic cypress binary cache failure of example-basic-pnpm workflow on Ubuntu HOT 5
- Cancel test run on Cypress cloud when action is cancelled HOT 1
- Cypress in Github Actions won't feed env variables to Oxygen server HOT 4
- Unable to run the cypress-io action when specifying a repo on the checkout HOT 2
- Geolocation error on final command of final test HOT 6
- Auto-Detect PR error on Workflow dispatch, resource not accessible HOT 4
- Receiving `Error: Cannot find module 'cypress'` error in GitHub actions HOT 8
- wait-on failing because of MaxRedirectsError HOT 5
- Unable to redirect to microsoft sso login page from app url when running cypress feature file using github action HOT 3
- Define Cypress custom script from the inputs HOT 2
- Github Actions finishes but Cypress dashboard stuck on "Pending" / Incomplete / Timed out HOT 6
- option to always return SUCCESS to GHA job step HOT 7
- The cypress npm package is installed, but the Cypress binary is missing. HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from github-action.