-
Notifications
You must be signed in to change notification settings - Fork 3
67 lines (59 loc) · 2.25 KB
/
dependency-analysis.yml
File metadata and controls
67 lines (59 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: "Dependency Analysis"
on: # yamllint disable-line rule:truthy
workflow_call:
inputs:
php-version:
description: "The PHP version to use when running the job"
default: "8.0"
required: false
type: "string"
php-extensions:
description: "The php extensions to install, allowing composer to pass"
default: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter, fileinfo"
required: false
type: "string"
composer-root-version:
description: "The version of the package being tested, in case of circular dependencies."
required: false
type: "string"
composer-options:
description: "Additional flags for the composer install command."
default: "--prefer-dist"
required: false
type: "string"
composer-dependencies:
description: "Composer dependency level to install"
default: "locked"
required: false
type: "string"
jobs:
dependency-analysis:
name: "Dependency Analysis"
runs-on: "ubuntu-latest"
strategy:
matrix:
php-version:
- "${{ inputs.php-version }}"
steps:
- name: "Checkout"
uses: "actions/checkout@v6"
- name: "Install PHP"
uses: "shivammathur/setup-php@2.37.0"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
extensions: "${{ inputs.php-extensions }}"
tools: "composer-require-checker"
- name: "Set COMPOSER_ROOT_VERSION"
run: |
echo "COMPOSER_ROOT_VERSION=${{ inputs.composer-root-version }}" >> $GITHUB_ENV
if: "${{ inputs.composer-root-version }}"
- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "${{ inputs.composer-dependencies }}"
composer-options: "${{ inputs.composer-options }}"
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m") # yamllint disable-line rule:quoted-strings
- name: "Run maglnet/composer-require-checker"
run: "composer-require-checker check --config-file=$(pwd)/composer-require-checker.json"