chilio / laravel-dusk-ci

Docker Test suite for Laravel Dusk in gitlab CI
MIT License
159 stars 51 forks source link

ERROR: Job failed: exit code 1 on GitLab CI #71

Closed rileysiemens closed 2 years ago

rileysiemens commented 2 years ago

I recently upgraded my site to PHP 8.1, and so I upgraded to the your PHP 8.1 image in my .gitlab-ci.yml file but now I get an error when it tries to build.

As you can see below, it seems to fail on the command npm run prod. But that command works locally, so I'm not sure what the problem is, and the error is not helpful. Is it a bug in the PHP 8.1 release of your image, or is it a problem with my configuration?

Here is the build section of .gitlab-ci.yml:

build:
  stage: build
  interruptible: true # When enabled, a running job can be cancelled when a new pipeline starts on the same branch.
  image: chilio/laravel-dusk-ci:php-8.1
  cache:
    - key:
        files:
          - composer.lock
      paths:
        - vendor/
    - key:
        files:
          - package-lock.json
      paths:
        - node_modules/
  script:
    - cp .env.gitlab-testing .env

    - composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts

    - npm ci
    - npm run prod

    - chmod -R 775 storage
    - chmod 775 bootstrap/cache
    - chown -R www-data ./
    - php artisan storage:link
  artifacts:
    name: "$CI_COMMIT_REF_NAME"
    paths:
      - .env
      - storage/
      - bootstrap/cache
      - vendor/
      - node_modules/
      - public/css/
      - public/js/
      - public/fonts/
    expire_in: 1 hour

And here's the output of the runner:

Running with gitlab-runner 14.10.1 (f761588f)
  on liddell2 h8o-Suv2
Preparing the "docker" executor
00:02
Using Docker executor with image chilio/laravel-dusk-ci:php-8.1 ...
Pulling docker image chilio/laravel-dusk-ci:php-8.1 ...
Using docker image sha256:b529d7fdffba447b7acfb6b41c705ce4b7e3257e721597c5ed0fd9bab2c373d1 for chilio/laravel-dusk-ci:php-8.1 with digest chilio/laravel-dusk-ci@sha256:f7e1040cc6bdce42a1b4eb3de71e5ef408bce91473e2099b879895a3b48dc70f ...
Preparing environment
00:00
Running on runner-h8o-suv2-project-23524763-concurrent-0 via 5efb45668828...
Getting source from Git repository
Fetching changes with git depth set to 50...
Reinitialized existing Git repository in /builds/my/repository/.git/
Checking out 7d039aa8 as 870-ui-refresh...
Removing .env
Removing node_modules/
Removing vendor/
Skipping Git submodules setup
Restoring cache
00:01
Checking cache for bda3ef736b8aa1a9917283a088cf3f291f22bde0-non_protected...
No URL provided, cache will not be downloaded from shared cache server. Instead a local version of cache will be extracted. 
Successfully extracted cache
Checking cache for 5c275d47e21fa9db678913b3ccc10f2f2a7a7b1b-non_protected...
No URL provided, cache will not be downloaded from shared cache server. Instead a local version of cache will be extracted. 
Successfully extracted cache
Executing "step_script" stage of the job script
Using docker image sha256:b529d7fdffba447b7acfb6b41c705ce4b7e3257e721597c5ed0fd9bab2c373d1 for chilio/laravel-dusk-ci:php-8.1 with digest chilio/laravel-dusk-ci@sha256:f7e1040cc6bdce42a1b4eb3de71e5ef408bce91473e2099b879895a3b48dc70f ...
$ cp .env.gitlab-testing .env
$ composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Package operations: 136 installs, 0 updates, 0 removals
  - Downloading aws/aws-crt-php (v1.0.2)
  - Downloading symfony/finder (v6.1.3)
  - Downloading symfony/polyfill-mbstring (v1.26.0)
  - Downloading symfony/var-dumper (v6.1.3)
  ...... [ installing and downloading composer packages ]
  - Installing spatie/flare-client-php (1.2.0): Extracting archive
  - Installing spatie/ignition (1.3.1): Extracting archive
  - Installing spatie/laravel-ignition (1.3.1): Extracting archive
  - Installing vrana/jush (v2.0.2): Extracting archive
Generating optimized autoload files
89 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
$ npm ci
npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
added 870 packages, and audited 871 packages in 28s
80 packages are looking for funding
  run `npm fund` for details
found 0 vulnerabilities
$ npm run prod
> prod
> npm run production
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 1
rileysiemens commented 2 years ago

UPDATE: in case anyone else has this issue changing this command solved the issue:

npm run production

to

npm run production --silent

source: https://stackoverflow.com/a/59857696/15786957

Morinohtar commented 2 years ago

Well, this is happening to me too and your solution didnt work. I still haven't been able to fix this...