Skip to content

Commit 87f8373

Browse files
authored
Merge pull request #31 from phansys/composer_lint
Add "Composer Lint" job to CI pipeline
2 parents 30e71af + d999b95 commit 87f8373

File tree

3 files changed

+68
-0
lines changed

3 files changed

+68
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
name: "Composer Lint"
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
php-version:
8+
description: "The PHP version to use when running the job"
9+
default: "8.1"
10+
required: false
11+
type: "string"
12+
13+
jobs:
14+
composer-lint:
15+
name: "Composer Lint"
16+
runs-on: "ubuntu-20.04"
17+
18+
strategy:
19+
matrix:
20+
php-version:
21+
- "${{ inputs.php-version }}"
22+
23+
steps:
24+
- name: "Checkout"
25+
uses: "actions/checkout@v3"
26+
27+
- name: "Install PHP"
28+
uses: "shivammathur/setup-php@v2"
29+
with:
30+
coverage: "none"
31+
php-version: "${{ matrix.php-version }}"
32+
tools: composer:v2, composer-normalize:2
33+
env:
34+
COMPOSER_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
35+
36+
- name: "Composer normmalize"
37+
run: "composer-normalize --dry-run"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "Composer Lint",
3+
"description": "Enforces consistency in the syntax of 'composer.json'",
4+
"iconName": "doctrine-logo",
5+
"categories": [
6+
"PHP"
7+
],
8+
"filePatterns": [
9+
"^composer\\.json$"
10+
]
11+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: "Composer Lint"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "*.x"
7+
paths:
8+
- "composer.json"
9+
push:
10+
branches:
11+
- "*.x"
12+
paths:
13+
- "composer.json"
14+
15+
jobs:
16+
composer-lint:
17+
name: "Composer Lint"
18+
uses: "doctrine/.github/.github/workflows/composer-lint.yml@use_a_valid_ref_here"
19+
with:
20+
php-version: "6.0" # use a custom version of PHP

0 commit comments

Comments
 (0)