Comments (13)
Disabled the cypress workflow in that branch and enabled it here in a new one instead: tidal-music/tidal-sdk-web#82
Run: https://github.com/tidal-music/tidal-sdk-web/actions/runs/8157333147/job/22296765645
from github-action.
We've added a new example .github/workflows/example-start-and-pnpm-workspaces.yml to show how the action can be used with pnpm workspaces and there is an explanation about the principle behind it on README > pnpm workspaces. The workflow itself is heavily commented.
You don't need to use this to solve your issue, it just avoids having to handle the Cypress binary cache manually.
Have you already got your workflow running?
from github-action.
It's running fine in our workflow now. Thanks.
from github-action.
- I will take a look at the final state of branch https://github.com/tidal-music/tidal-sdk-web/tree/player-release/0.1.3 which is the branch linked to your PR tidal-music/tidal-sdk-web#80.
from github-action.
The branch https://github.com/tidal-music/tidal-sdk-web/tree/player-release/0.1.3 which I was going to look at has been deleted, so it's difficult for me to investigate your latest attempt. (OK - I saw you just moved it.)
- In the meantime I reviewed the result of the issue #1054 which you tagged on to and there is a working example for a pnpm workspace in https://github.com/markoleavy/cypress-test/blob/main/.github/workflows/run_test.yml
jobs:
run-test:
runs-on: ubuntu-22.04
name: Run test
timeout-minutes: 60
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: Setup Node 18
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Set up Cypress binary cache
uses: actions/cache@v3
with:
path: ~/.cache/Cypress
key: cypress-${{ runner.os }}-cypress-${{ hashFiles('pnpm-lock.yaml') }}
- name: Install dependencies
run: |
pnpm i --frozen-lockfile
- name: Test
uses: cypress-io/github-action@v6
with:
install: false
working-directory: ./packages/test/
browser: chrome
That would probably work in principle for you too, updating the versions of the actions used and changing the directory from test
to player
.
from github-action.
You can let me know if you want to try that out for yourself, or if you want me to work on your branch https://github.com/tidal-music/tidal-sdk-web/tree/re-enable-cypress.
from github-action.
I tried that in this commit: https://github.com/tidal-music/tidal-sdk-web/blob/2f296807920c63dfffe5108b3c03112977065310/.github/workflows/cypress.yml
Output for that run was the same: https://github.com/tidal-music/tidal-sdk-web/actions/runs/8153523957/job/22285090231
from github-action.
I ran the following successfully in a fork of your repo. I suspect this failed for you previously due to the pnpm cache preventing the Cypress binary installing.
If you cache the pnpm store and then you add caching for Cypress without allowing for Cypress to install and run the postinstallation script (again) to install the Cypress binary, then the Cypress binary will never be installed and can't be cached.
If you delete the relevant cache from https://github.com/tidal-music/tidal-sdk-web/actions/caches after you have added Cypress binary caching then pnpm will reinstall everything and Cypress will get its binary installed and cached.
jobs:
cypress-run:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: ./.github/actions/setup
- uses: ./.github/actions/build-projects
- name: Prepare test user for player tests
id: json
run: |
echo ${{ env.TEST_USER }} | base64 -d > test-user.json
json=$(cat test-user.json)
replacement=${{ secrets.PLAYER_REFRESH_TOKEN }}
fixed_json="$(echo ${json/\[TOKEN\]/$replacement})"
encoded_json=$(echo "$fixed_json" | base64 | tr -d '\n')
echo "encoded=\"$encoded_json\"" >> $GITHUB_OUTPUT
env:
TEST_USER: ${{ secrets.PLAYER_TEST_USER }}
- name: Set up Cypress binary cache
uses: actions/cache@v4
with:
path: ~/.cache/Cypress
key: ${{ runner.os }}-cypress-${{ hashFiles('pnpm-lock.yaml') }}
- name: Cypress run
uses: cypress-io/github-action@v6
env:
CYPRESS_TEST_USER: ${{ steps.json.outputs.encoded }}
with:
install: false
browser: chrome
start: pnpm --dir packages/player/ dev
wait-on: 'http://localhost:5173/demo/test-case-1.html'
command: pnpm --dir packages/player/ internal:cypress:run
from github-action.
I ran the following successfully in a fork of your repo. I suspect this failed for you previously due to the pnpm cache preventing the Cypress binary installing.
/.../
If you delete the relevant cache from https://github.com/tidal-music/tidal-sdk-web/actions/caches after you have added Cypress binary caching then pnpm will reinstall everything and Cypress will get its binary installed and cached.
That worked! Now it runs again. Thank you very much Mike!
Would the hash not changing be an issue for pnpm/action-setup or is the fact that Cypress store it outside the module folder the "issue" (outside their scope/concern), which needs this extra cache step?
from github-action.
Hm, my second run failed on the binary missing again. I don't see a ${{ runner.os }}-cypress-${{ hashFiles('pnpm-lock.yaml') }}
entry in caches though... https://github.com/tidal-music/tidal-sdk-web/actions/runs/8170953305/job/22338441775?pr=82
from github-action.
Found this, I guess this is what I'm seeing. I need to run on the main branch. https://github.com/orgs/community/discussions/27059
from github-action.
GitHub caches are linked to the branch of the workflow which addresses the cache.
To test workflows using caches you always need to run a workflow twice. Once to populate the cache and then a second time to make sure that the cached contents is being picked up.
It sounds like you have found your issue. Come back here again if you still can't get it to work and I will take another look.
Would the hash not changing be an issue for pnpm/action-setup or is the fact that Cypress store it outside the module folder the "issue" (outside their scope/concern), which needs this extra cache step?
The Cypress binary cache is outside of the scope of the pnpm cache store.
from github-action.
I suggest to close this issue now, as this is not a bug in the action.
- I've added also an enhancement request #1144
from github-action.
Related Issues (20)
- App frontend is not reachable, on random test runs HOT 5
- pnpm workspaces workflow shows "no status" HOT 2
- Add workspace support for pnpm HOT 10
- Save Test Results to File or Action Output HOT 6
- 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
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.