act icon indicating copy to clipboard operation
act copied to clipboard

Doesn't "pull or build the necessary images" when testing Cypress action

Open GeorgeXCV opened this issue 1 year ago • 9 comments

Bug report info

act version:            0.2.30
GOOS:                   darwin
GOARCH:                 arm64
NumCPU:                 10
Docker host:            DOCKER_HOST environment variable is unset/empty.
Sockets found:
        /var/run/docker.sock
Config files:           
        /Users/georgeashton/.actrc:
                -P ubuntu-latest=catthehacker/ubuntu:act-latest
                -P ubuntu-22.04=catthehacker/ubuntu:act-22.04
                -P ubuntu-20.04=catthehacker/ubuntu:act-20.04
                -P ubuntu-18.04=catthehacker/ubuntu:act-18.04
Build info:
        Go version:            go1.18.4
        Module path:           command-line-arguments
        Main version:          
        Main path:             
        Main checksum:         
        Build settings:
                -compiler:            gc
                -ldflags:             -X main.version=0.2.30
                CGO_ENABLED:          1
                CGO_CFLAGS:           
                CGO_CPPFLAGS:         
                CGO_CXXFLAGS:         
                CGO_LDFLAGS:          
                GOARCH:               arm64
                GOOS:                 darwin
Docker Engine:
        Engine version:        20.10.17
        Engine runtime:        runc
        Cgroup version:        2
        Cgroup driver:         cgroupfs
        Storage driver:        overlay2
        Registry URI:          https://index.docker.io/v1/
        OS:                    Docker Desktop
        OS type:               linux
        OS version:            
        OS arch:               aarch64
        OS kernel:             5.10.104-linuxkit
        OS CPU:                5
        OS memory:             7851 MB
        Security options:
                name=seccomp,profile=default
                name=cgroupns

Command used with act

act -v

Describe issue

I'm trying to test this Github workflow but it just won't run, always complains about missing dependencies. I thought the point of this project was it took care of that? Its looking like i might have to make Dockerfile or change the workflow? But then at that point I have different workflow which won't won't be used as not using Docker in the repo...

Link to GitHub repository

No response

Workflow content

name: Daily Regression Tests

on: [push]
  # schedule:
  #   #https://crontab.guru/#0_0_*_*_*
  #   - cron: "0 0 * * *"

jobs:
  cypress-run:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      # Install NPM dependencies, cache them correctly
      # and run all Cypress tests
      - name: Cypress run
        uses: cypress-io/github-action@v4
        with:
          start: npm start -- --record
        env:
          # pass the Dashboard record key as an environment variable
          CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}

Relevant log output

[Daily Regression Tests/cypress-run] [DEBUG] About to run action &{Cypress.io Gleb Bahmutov GitHub Action for running Cypress end-to-end tests map[browser:{Name of the browser to use false } build:{Command to run in build step before starting tests false } cache-key:{Custom cache key false } ci-build-id:{ID associates multiple CI machines to one test run false } command:{Command that overrides cypress run false } command-prefix:{You can prefix the default test command using the command-prefix option. false } component:{Lets the action know that Cypress is running component tests and not e2e tests false false} config:{Set configuration values. Separate multiple values with a comma. The values set here override any values set in your configuration file. false } config-file:{Path to the cypress config file where configuration values are set. false } env:{Sets Cypress environment variables false } group:{Group setting for tests false } headed:{Whether or not to use headed mode false } install:{Whether or not to run install false } install-command:{Custom install command to use false } parallel:{Whether or not to load balance tests using multiple containers false } project:{Path of project to run false } quiet:{Whether or not to silence any Cypress specific output from stdout false } record:{Sends test results to Cypress Dashboard false false} runTests:{Whether or not to run tests false } spec:{Provide a specific specs to run false } start:{Command for starting local server in the background false } start-windows:{A different start command on Windows false } tag:{Tag setting for tests false } wait-on:{Local server URL to wait for false } wait-on-timeout:{Amount of time to wait for wait-on url to be available false } working-directory:{Working directory containing Cypress folder false }] map[dashboardUrl:{Cypress Dashboard URL if the run was recorded }] {node16 map[] dist/index.js  always()  always()   [] []} {green check-square}}
[Daily Regression Tests/cypress-run] [DEBUG] Loading slug from git directory '/Users/georgeashton/Documents/nansen-core-cypress/.git'
[Daily Regression Tests/cypress-run] [DEBUG] Loading revision from git directory '/Users/georgeashton/Documents/nansen-core-cypress/.git'
[Daily Regression Tests/cypress-run] [DEBUG] Found revision: 72eb85570b6ce52503eeb06a1efa9c25f71879a7
[Daily Regression Tests/cypress-run] [DEBUG] HEAD points to '72eb85570b6ce52503eeb06a1efa9c25f71879a7'
[Daily Regression Tests/cypress-run] [DEBUG] using github ref: refs/heads/cypress-dashboard
[Daily Regression Tests/cypress-run] [DEBUG] Found revision: 72eb85570b6ce52503eeb06a1efa9c25f71879a7
[Daily Regression Tests/cypress-run] [DEBUG] Loading slug from git directory '/Users/georgeashton/Documents/nansen-core-cypress/.git'
[Daily Regression Tests/cypress-run] [DEBUG] Loading revision from git directory '/Users/georgeashton/Documents/nansen-core-cypress/.git'
[Daily Regression Tests/cypress-run] [DEBUG] Found revision: 72eb85570b6ce52503eeb06a1efa9c25f71879a7
[Daily Regression Tests/cypress-run] [DEBUG] HEAD points to '72eb85570b6ce52503eeb06a1efa9c25f71879a7'
[Daily Regression Tests/cypress-run] [DEBUG] using github ref: refs/heads/cypress-dashboard
[Daily Regression Tests/cypress-run] [DEBUG] Found revision: 72eb85570b6ce52503eeb06a1efa9c25f71879a7
[Daily Regression Tests/cypress-run] [DEBUG] type=3 actionDir=/Users/georgeashton/.cache/act/cypress-io-github-action@v4 actionPath= workdir=/Users/georgeashton/Documents/nansen-core-cypress actionCacheDir=/Users/georgeashton/.cache/act actionName=cypress-io-github-action@v4 containerActionDir=/var/run/act/actions/cypress-io-github-action@v4
[Daily Regression Tests/cypress-run] [DEBUG] /var/run/act/actions/cypress-io-github-action@v4
[Daily Regression Tests/cypress-run]   🐳  docker cp src=/Users/georgeashton/.cache/act/cypress-io-github-action@v4/ dst=/var/run/act/actions/cypress-io-github-action@v4/
[Daily Regression Tests/cypress-run] [DEBUG] Writing tarball /var/folders/41/f9x25ymj3tq346ktt9fh19zr0000gn/T/act1966009785 from /Users/georgeashton/.cache/act/cypress-io-github-action@v4/
[Daily Regression Tests/cypress-run] [DEBUG] Stripping prefix:/Users/georgeashton/.cache/act/cypress-io-github-action@v4/ src:/Users/georgeashton/.cache/act/cypress-io-github-action@v4/
[Daily Regression Tests/cypress-run] [DEBUG] Extracting content from '/var/folders/41/f9x25ymj3tq346ktt9fh19zr0000gn/T/act1966009785' to '/var/run/act/actions/cypress-io-github-action@v4/'
[Daily Regression Tests/cypress-run] close /var/folders/41/f9x25ymj3tq346ktt9fh19zr0000gn/T/act1966009785: file already closed
[Daily Regression Tests/cypress-run] [DEBUG] executing remote job container: [node /var/run/act/actions/cypress-io-github-action@v4/dist/index.js]
[Daily Regression Tests/cypress-run]   🐳  docker exec cmd=[node /var/run/act/actions/cypress-io-github-action@v4/dist/index.js] user= workdir=
[Daily Regression Tests/cypress-run] [DEBUG] Exec command '[node /var/run/act/actions/cypress-io-github-action@v4/dist/index.js]'
[Daily Regression Tests/cypress-run] [DEBUG] Working directory '/Users/georgeashton/Documents/nansen-core-cypress'
[Daily Regression Tests/cypress-run]   💬  ::debug::Resolved Keys:
[Daily Regression Tests/cypress-run]   💬  ::debug::["npm-linux-arm64-f90b61aba1a07d278aeae47ce5538da902c297753463289589503e61752daf9e4bfe8ae166155bb2b8298eab805fc02b6dc3f205a52c7191bffbe32aa24c5c9d","npm-linux-arm64-f90b61aba1a07d278aeae47ce5538da902c297753463289589503e61752daf9e4bfe8ae166155bb2b8298eab805fc02b6dc3f205a52c7191bffbe32aa24c5c9d"]
[Daily Regression Tests/cypress-run]   💬  ::debug::Checking zstd --version
[Daily Regression Tests/cypress-run]   💬  ::debug::Resolved Keys:
[Daily Regression Tests/cypress-run]   💬  ::debug::["cypress-linux-arm64-f90b61aba1a07d278aeae47ce5538da902c297753463289589503e61752daf9e4bfe8ae166155bb2b8298eab805fc02b6dc3f205a52c7191bffbe32aa24c5c9d","cypress-linux-arm64-f90b61aba1a07d278aeae47ce5538da902c297753463289589503e61752daf9e4bfe8ae166155bb2b8298eab805fc02b6dc3f205a52c7191bffbe32aa24c5c9d"]
[Daily Regression Tests/cypress-run]   💬  ::debug::Checking zstd --version
[Daily Regression Tests/cypress-run]   💬  ::debug::*** zstd command line interface 64-bits v1.4.4, by Yann Collet ***
[Daily Regression Tests/cypress-run]   💬  ::debug::getCacheEntry - Attempt 1 of 2 failed with error: Cache Service Url not found, unable to restore cache.
[Daily Regression Tests/cypress-run]   💬  ::debug::*** zstd command line interface 64-bits v1.4.4, by Yann Collet ***
[Daily Regression Tests/cypress-run]   💬  ::debug::getCacheEntry - Attempt 1 of 2 failed with error: Cache Service Url not found, unable to restore cache.
[Daily Regression Tests/cypress-run]   💬  ::debug::getCacheEntry - Attempt 2 of 2 failed with error: Cache Service Url not found, unable to restore cache.
[Daily Regression Tests/cypress-run]   💬  ::debug::getCacheEntry - Attempt 2 of 2 failed with error: Cache Service Url not found, unable to restore cache.
| Restoring NPM cache error: getCacheEntry failed: Cache Service Url not found, unable to restore cache.
| Restoring Cypress cache error: getCacheEntry failed: Cache Service Url not found, unable to restore cache.
| [command]/opt/hostedtoolcache/node/16.16.0/arm64/bin/npm ci
| 
| added 376 packages, and audited 377 packages in 26s
| 
| 67 packages are looking for funding
|   run `npm fund` for details
| 
| found 0 vulnerabilities
| [command]/opt/hostedtoolcache/node/16.16.0/arm64/bin/npx cypress cache list
| ┌─────────┬─────────────┐
| │ version │ last used   │
| ├─────────┼─────────────┤
| │ 10.3.0  │ a month ago │
| └─────────┴─────────────┘
| [command]/opt/hostedtoolcache/node/16.16.0/arm64/bin/npx cypress verify
| 
| [STARTED] Task without title.
| [FAILED] Your system is missing the dependency: Xvfb
| [FAILED] 
| [FAILED] Install Xvfb and run Cypress again.
| [FAILED] 
| [FAILED] Read our documentation on dependencies for more information:
| [FAILED] 
| [FAILED] https://on.cypress.io/required-dependencies
| [FAILED] 
| [FAILED] If you are using Docker, we provide containers with all required dependencies installed.
| [FAILED] 
| [FAILED] ----------
| [FAILED] 
| [FAILED] Error: spawn Xvfb ENOENT
| [FAILED] 
| [FAILED] ----------
| [FAILED] 
| [FAILED] Platform: linux-arm64 (Ubuntu - 20.04)
| [FAILED] Cypress Version: 10.3.0
| Your system is missing the dependency: Xvfb
| 
| Install Xvfb and run Cypress again.
| 
| Read our documentation on dependencies for more information:
| 
| https://on.cypress.io/required-dependencies
| 
| If you are using Docker, we provide containers with all required dependencies installed.
| 
| ----------
| 
| Error: spawn Xvfb ENOENT
| 
| ----------
| 
| Platform: linux-arm64 (Ubuntu - 20.04)
| Cypress Version: 10.3.0
[Daily Regression Tests/cypress-run]   ❗  ::error::The process '/opt/hostedtoolcache/node/16.16.0/arm64/bin/npx' failed with exit code 1
[Daily Regression Tests/cypress-run]   ❌  Failure - Main Cypress run
[Daily Regression Tests/cypress-run] exitcode '1': failure
[Daily Regression Tests/cypress-run] [DEBUG] skipping post step for 'Checkout': no action model available
[Daily Regression Tests/cypress-run] 🏁  Job failed

Additional information

Also tried:

name: Install
  run: sudo apt-get install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb

And:

runs-on: ubuntu-latest
image: cypress/included:9.4.1

GeorgeXCV avatar Aug 10 '22 10:08 GeorgeXCV

Issue is stale and will be closed in 14 days unless there is new activity

github-actions[bot] avatar Sep 10 '22 00:09 github-actions[bot]

Thanks for the maintainers' work on act, it's saved me a ton of time 🙇

I've also seen this error and have tried a number of workarounds, including running with the catthehacker/ubuntu:full-latest image, but when I do I get the following error instead:

| > [email protected] postinstall /Users/alessiabellisario/Documents/router-defer-e2e-tests/CRA-demo/node_modules/cypress
| > node index.js --exec install
|
| Note: Overriding Cypress cache directory to: /root/.cache/Cypress
|
|       Previous installs of Cypress may not be found.
|
| Cypress cannot write to the cache directory due to file permissions
|
| See discussion and possible solutions at
| https://github.com/cypress-io/cypress/issues/1281
|
| ----------
|
| Failed to access /root/.cache/Cypress:
|
| EACCES: permission denied, mkdir '/root/.cache/Cypress'

alessbell avatar Sep 15 '22 16:09 alessbell

Issue is stale and will be closed in 14 days unless there is new activity

github-actions[bot] avatar Oct 16 '22 00:10 github-actions[bot]

Issue is stale and will be closed in 14 days unless there is new activity.

…will forever haunt me in my dreams.

mixn avatar Dec 07 '22 17:12 mixn

This issue is still happening

andreifilip123 avatar Dec 12 '22 14:12 andreifilip123

Could you provide a link to a public repository with this issue? Otherwise I wouldn't be able to help you to fix the potential bug. I add a stale exempt for you, I'm not a fan of this stale bot.

ChristopherHX avatar Dec 12 '22 21:12 ChristopherHX

Thank you !

Here's the example repo: https://github.com/andreifilip123/cypress-act

I added the .actrc (even tho I think it's not used) & docker.compose.yml for the artifact server (solution found in a different issue)

andreifilip123 avatar Dec 13 '22 07:12 andreifilip123

@andreifilip123 Your sample has no yarn start script? I get: Via git clone https://github.com/nektos/act && cd act && go build && cd .. && git clone https://github.com/andreifilip123/cypress-act && cd cypress-act && ../act/act -v -P ubuntu-latest=cypress/browsers:node18.12.0-chrome107 workflow_dispatch

...
| [command]/usr/local/bin/yarn start
[Cypress Tests/cypress-run]   | yarn run v1.22.19
[Cypress Tests/cypress-run]   | error Command "start" not found.
[Cypress Tests/cypress-run]   | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

yarn start is provided to the cypress action as an input of your workflow. The dependency error has been resolved by using the correct docker image for cypress via -P ubuntu-latest=cypress/browsers:node18.12.0-chrome107

ChristopherHX avatar Dec 13 '22 08:12 ChristopherHX

You're right, the repo I provided doesn't have yarn start 😅 Anyway, the issue I had with dependencies is solved by -P ubuntu-latest=cypress/browsers:node18.12.0-chrome107. I thought I need to use the ubuntu-act image. Thanks for your help!

andreifilip123 avatar Dec 13 '22 11:12 andreifilip123

For me it's hard to assume act did not bring improvements while I'm using a custom image.

Except if there is a watcher for act images that rebuild one with browsers stuff, I won't go this way.

The solution I use for now is to bring a conditional step in my workflow:

      - name: Install `Xvfb` and others to run browsers for end-to-end testing in local CI/CD simulations
        if: ${{ env.ACT }}
        run: sudo apt-get update && sudo apt-get install -y xvfb && npx playwright install-deps

(I had playwright+cypress so I'm using the helper from Playwright, but I guess Cypress also has a npx script?) (I use --reuse so apt-get commands are partially run each time)

sneko avatar Jan 18 '23 16:01 sneko