Skip to content

Commit b237abf

Browse files
committed
Add dependency workflow
1 parent e8a7afa commit b237abf

1 file changed

Lines changed: 65 additions & 0 deletions

File tree

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: "Dependency Analysis"
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
php-version:
7+
description: "The PHP version to use when running the job"
8+
default: "8.0"
9+
required: false
10+
type: "string"
11+
php-extensions:
12+
description: "The php extensions to install, allowing composer to pass"
13+
default: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter, fileinfo"
14+
required: false
15+
type: "string"
16+
composer-root-version:
17+
description: "The version of the package being tested, in case of circular dependencies."
18+
required: false
19+
type: "string"
20+
composer-options:
21+
description: "Additional flags for the composer install command."
22+
default: "--prefer-dist"
23+
required: false
24+
type: "string"
25+
composer-dependencies:
26+
description: "Composer dependency level to install"
27+
default: "locked"
28+
required: false
29+
type: "string"
30+
31+
jobs:
32+
dependency-analysis:
33+
name: "Dependency Analysis"
34+
runs-on: "ubuntu-latest"
35+
36+
strategy:
37+
matrix:
38+
php-version:
39+
- "${{ inputs.php-version }}"
40+
41+
steps:
42+
- name: "Checkout"
43+
uses: "actions/checkout@v2"
44+
45+
- name: "Install PHP"
46+
uses: "shivammathur/setup-php@v2"
47+
with:
48+
coverage: "none"
49+
php-version: "${{ matrix.php-version }}"
50+
extensions: "${{ inputs.php-extensions }}"
51+
tools: "composer-require-checker"
52+
53+
- name: "Set COMPOSER_ROOT_VERSION"
54+
run: |
55+
echo "COMPOSER_ROOT_VERSION=${{ inputs.composer-root-version }}" >> $GITHUB_ENV
56+
if: "${{ inputs.composer-root-version }}"
57+
58+
- name: "Install dependencies with Composer"
59+
uses: "ramsey/composer-install@v1"
60+
with:
61+
dependency-versions: "${{ inputs.composer-dependencies }}"
62+
composer-options: "${{ inputs.composer-options }}"
63+
64+
- name: "Run maglnet/composer-require-checker"
65+
run: "composer-require-checker check --config-file=$(pwd)/composer-require-checker.json"

0 commit comments

Comments
 (0)