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

How to install php-zip extention on scrutinizer-ci?

我尝试在我的存储库上使用 scrutinizer,但是 return:

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.

如何安装 zip 扩展?

我试过使用这个配置但没有用:

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


看看这个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

正确的配置是:

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 (I googled with keyword '.scrutinizer.yml php github zip'), but actually already described on the official docs 复制过来。我读了它但被误解了。