Skip to content

Commit b1b6ed2

Browse files
committed
ci: add composer normalize check
1 parent f54455c commit b1b6ed2

File tree

1 file changed

+60
-1
lines changed

1 file changed

+60
-1
lines changed

.github/workflows/coding-standards.yml

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,65 @@ jobs:
6363
**/*.md
6464
!CHANGELOG.md
6565
66+
composer-linting:
67+
timeout-minutes: 4
68+
runs-on: ${{ matrix.os }}
69+
concurrency:
70+
cancel-in-progress: true
71+
group: composer-linting-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
72+
strategy:
73+
matrix:
74+
os:
75+
- ubuntu-latest
76+
php-version:
77+
- '8.1'
78+
dependencies:
79+
- locked
80+
permissions:
81+
contents: write
82+
steps:
83+
- name: 🛠️ Setup PHP
84+
uses: shivammathur/setup-php@2.30.4
85+
with:
86+
php-version: ${{ matrix.php-version }}
87+
extensions: none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter, phar
88+
ini-values: error_reporting=E_ALL
89+
coverage: none
90+
91+
- name: 📦 Check out the codebase
92+
uses: actions/checkout@v4.1.5
93+
94+
- name: 🛠️ Setup problem matchers
95+
run: |
96+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
97+
98+
- name: 🤖 Validate composer.json and composer.lock
99+
run: composer validate --ansi --strict
100+
101+
- name: 🔍 Get composer cache directory
102+
uses: wayofdev/gh-actions/actions/composer/get-cache-directory@v3.1.0
103+
104+
- name: ♻️ Restore cached dependencies installed with composer
105+
uses: actions/cache@v4.0.2
106+
with:
107+
path: ${{ env.COMPOSER_CACHE_DIR }}
108+
key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}
109+
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-
110+
111+
- name: 📥 Install "${{ matrix.dependencies }}" dependencies with composer
112+
uses: wayofdev/gh-actions/actions/composer/install@v3.1.0
113+
with:
114+
dependencies: ${{ matrix.dependencies }}
115+
116+
- name: 📥 Install dependencies with phive
117+
uses: wayofdev/gh-actions/actions/phive/install@v3.1.0
118+
with:
119+
phive-home: '.phive'
120+
trust-gpg-keys: 0xC00543248C87FB13,0x033E5F8D801A2F8D
121+
122+
- name: 🔍 Run ergebnis/composer-normalize
123+
run: .phive/composer-normalize --ansi --dry-run
124+
66125
coding-standards:
67126
timeout-minutes: 4
68127
runs-on: ${{ matrix.os }}
@@ -89,7 +148,7 @@ jobs:
89148
uses: shivammathur/setup-php@2.30.4
90149
with:
91150
php-version: ${{ matrix.php-version }}
92-
extensions: none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter, sockets
151+
extensions: none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter
93152
ini-values: error_reporting=E_ALL
94153
coverage: none
95154

0 commit comments

Comments
 (0)