Commit 447e54c5 authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

feat: add composer outdated job (manual)

parent 830038cd
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -140,3 +140,15 @@ It is bound to the `test` stage, and uses the following variables:
| `PHP_SBOM_DISABLED` | Set to `true` to disable this job | _none_ |
| `PHP_SBOM_VERSION` | The version of @cyclonedx/cyclonedx-php used to emit SBOM | _none_ (uses latest) |
| `PHP_SBOM_OPTS` | [@cyclonedx/cyclonedx-php options](https://github.com/CycloneDX/cyclonedx-php-composer#usage) used for SBOM analysis | `--exclude-plugins --exclude-dev` |

### `php-outdated` job

This job shows the list of installed packages that have updates available (uses [`composer outdated`](https://getcomposer.org/doc/03-cli.md#outdated)).

It is bound to the `test` stage, and can be run manually at will.

It uses the following variable:

| Name                | description                              | default value     |
| ------------------- | ---------------------------------------- | ----------------- |
| `PHP_OUTDATED_OPTS` | [`composer outdated` options](https://getcomposer.org/doc/03-cli.md#outdated) | `--direct` |
+13 −0
Original line number Diff line number Diff line
@@ -61,6 +61,19 @@
          "advanced": true
        }
      ]
    },
    {
      "id": "outdated",
      "name": "composer outdated",
      "description": "Shows the list of installed packages that have updates available (uses [`composer outdated`](https://getcomposer.org/doc/03-cli.md#outdated))",
      "variables": [
        {
          "name": "PHP_OUTDATED_OPTS",
          "description": "[`composer outdated` options](https://getcomposer.org/doc/03-cli.md#outdated)",
          "default": "--direct",
          "advanced": true
        }
      ]
    }
  ]
}
+15 −0
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ variables:

  # Version of the cyclonedx/cyclonedx-php-composer used for SBOM analysis
  PHP_SBOM_OPTS: "--exclude-plugins --exclude-dev"
  PHP_OUTDATED_OPTS: "--direct"

  # default production ref name (pattern)
  PROD_REF: '/^(master|main)$/'
@@ -311,6 +312,20 @@ php-unit:
      when: never
    - !reference [.test-policy, rules]

php-outdated:
  extends: .php-base
  stage: test
  dependencies: []
  script:
    - docomposer outdated --strict $PHP_OUTDATED_OPTS
  rules:
    # on schedule: auto
    - if: '$CI_PIPELINE_SOURCE == "schedule"'
      allow_failure: true
    # else manual & non-blocking
    - when: manual
      allow_failure: true

php-codesniffer:
  stage: test
  extends: .php-base