如何在 scrutinizer-ci 上安装 php-zip 扩展?

问题描述

我试图在我的仓库中使用 scrutinizer 但返回:

const Header = ({ siteTitle }) => {
  const path = window.location.pathname;
  return ( 
    <>
      <header>

如何安装 zip 扩展?

我尝试使用此配置但不起作用:

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for laravel/dusk v6.10.0 -> satisfiable by laravel/dusk[v6.10.0].
    - laravel/dusk v6.10.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
  Problem 2
    - Installation request for php-webdriver/webdriver 1.9.0 -> satisfiable by php-webdriver/webdriver[1.9.0].
    - php-webdriver/webdriver 1.9.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.

  To enable extensions,verify that they are enabled in your .ini files:
    - /home/scrutinizer/.phpenv/versions/7.3.15/etc/php.ini
    - /home/scrutinizer/.phpenv/versions/7.3.15/etc/conf.d/pyrus.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

解决方法

正确的配置是:

build:
    tests:
        override:
            - true

    nodes:
        tests:
            environment:
                php:
                    version: 7.4
                    pecl_extensions:
                        - zip
        analysis:
            environment:
                php:
                    version: 7.4
                    pecl_extensions:
                        - zip
            tests:
                override: [php-scrutinizer-run]

我刚刚从 this repo 复制(我用关键字“.scrutinizer.yml php github zip”搜索),但实际上已经在 official docs 上进行了描述。我读过但被误解了。

,


看看这个link

如果你想安装abc,你应该这样做:

build:
  nodes:
    some-node:
      dependencies:
        before:
          - sudo apt-get install -y abc

在您的示例中,您可以这样做:

build:
    nodes:
        analysis:
            dependencies:
                before:
                    - sudo apt-get install -y zip unzip php-zip
            project_setup:
                override:
                    - 'true'
            tests:
                override:
                    - php-scrutinizer-run
                    -
                        command: phpcs-run
                        use_website_config: true
                    - js-scrutinizer-run
        tests: true

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...