Skip to content

Commit b7267fb

Browse files
Copilotsoyuka
andcommitted
Add Redocly OpenAPI linter to CI workflow
Co-authored-by: soyuka <1321971+soyuka@users.noreply.github.com>
1 parent edf29db commit b7267fb

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

.github/workflows/ci.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,57 @@ jobs:
178178
run: |
179179
./vendor/bin/phpstan analyse --no-interaction --no-progress --ansi
180180
181+
redocly-lint:
182+
name: Lint OpenAPI with Redocly
183+
runs-on: ubuntu-latest
184+
timeout-minutes: 20
185+
strategy:
186+
matrix:
187+
php:
188+
- '8.4'
189+
fail-fast: false
190+
steps:
191+
- name: Checkout
192+
uses: actions/checkout@v6
193+
- name: Setup PHP
194+
uses: shivammathur/setup-php@v2
195+
with:
196+
php-version: ${{ matrix.php }}
197+
extensions: intl, bcmath, curl, openssl, mbstring
198+
ini-values: memory_limit=-1
199+
tools: composer
200+
coverage: none
201+
- name: Get composer cache directory
202+
id: composercache
203+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
204+
- name: Cache dependencies
205+
uses: actions/cache@v5
206+
with:
207+
path: ${{ steps.composercache.outputs.dir }}
208+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
209+
restore-keys: ${{ runner.os }}-composer-
210+
- name: Update project dependencies
211+
run: |
212+
composer global require soyuka/pmu
213+
composer global config allow-plugins.soyuka/pmu true --no-interaction
214+
composer global link .
215+
- name: Setup Node.js
216+
uses: actions/setup-node@v4
217+
with:
218+
node-version: '20'
219+
- name: Install Redocly CLI
220+
run: npm install -g @redocly/cli@latest
221+
- name: Clear test app cache
222+
run: |
223+
rm -Rf tests/Fixtures/app/var/cache/*
224+
tests/Fixtures/app/console cache:warmup
225+
- name: Generate OpenAPI spec
226+
run: |
227+
mkdir -p /tmp/openapi
228+
tests/Fixtures/app/console api:openapi:export --output=/tmp/openapi/openapi.json --no-ansi
229+
- name: Lint OpenAPI spec with Redocly
230+
run: redocly lint /tmp/openapi/openapi.json
231+
181232
phpunit:
182233
name: PHPUnit (PHP ${{ matrix.php }})
183234
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)