Skip to content

Commit 7b239f2

Browse files
chore(ci): add mago workflow to validate linting and formatting (#14)
1 parent 3bb5747 commit 7b239f2

File tree

3 files changed

+44
-8
lines changed

3 files changed

+44
-8
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Run code quality
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Setup PHP with PECL extension
20+
uses: shivammathur/setup-php@v2
21+
with:
22+
php-version: "8.4"
23+
24+
- name: Validate composer.json and composer.lock
25+
run: composer validate --strict
26+
27+
- name: Cache Composer packages
28+
id: composer-cache
29+
uses: actions/cache@v3
30+
with:
31+
path: vendor
32+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
33+
restore-keys: |
34+
${{ runner.os }}-php-
35+
36+
- name: Install dependencies
37+
run: |
38+
composer install --prefer-dist --no-progress
39+
40+
- name: Run Mago
41+
run: |
42+
vendor/bin/mago fmt --dry-run
43+
vendor/bin/mago lint --reporting-format=github

phpunit.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
<phpunit
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd"
5+
bootstrap="vendor/autoload.php"
56
colors="true"
67
displayDetailsOnTestsThatTriggerDeprecations="true"
78
displayDetailsOnTestsThatTriggerErrors="true"
89
displayDetailsOnTestsThatTriggerNotices="true"
910
displayDetailsOnTestsThatTriggerWarnings="true"
10-
bootstrap="./tests/bootstrap.php"
1111
cacheDirectory=".cache/phpunit"
1212
>
1313
<testsuites>

tests/bootstrap.php

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)