Skip to content

Commit 25f4985

Browse files
authored
feat(ci): setup gha
2 parents 7616aca + d07d55b commit 25f4985

12 files changed

Lines changed: 417 additions & 229 deletions
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: PHP Code Quality Checks
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
push:
7+
branches: [ main ]
8+
9+
jobs:
10+
code-quality:
11+
name: Code Quality
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Setup PHP
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: '8.3'
22+
coverage: none
23+
tools: composer:v2
24+
25+
- name: Get composer cache directory
26+
id: composer-cache
27+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
28+
29+
- name: Cache dependencies
30+
uses: actions/cache@v3
31+
with:
32+
path: ${{ steps.composer-cache.outputs.dir }}
33+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
34+
restore-keys: ${{ runner.os }}-composer-
35+
36+
- name: Install dependencies
37+
run: composer install --prefer-dist --no-progress
38+
39+
- name: Run PHP CS Fixer
40+
run: composer cs-check
41+
42+
- name: Run PHPStan
43+
run: composer phpstan

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
A PHP library designed to simplify interaction with the dotCMS Page API. This SDK provides a clean, object-oriented interface for retrieving and working with dotCMS pages and their components.
44

5+
[![PHP Code Quality Checks](https://github.com/dotCMS/dotcms-php-sdk/actions/workflows/php-quality-checks.yml/badge.svg)](https://github.com/dotCMS/dotcms-php-sdk/actions/workflows/php-quality-checks.yml)
6+
57
## Requirements
68

79
- PHP 8.2 or higher

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"name": "dotcms/php-sdk",
33
"description": "The `dotcms-php-sdk` is a PHP library designed to simplify interaction with the dotCMS Page API",
44
"type": "library",
5-
"version": "1.0.0",
65
"require": {
76
"php": "^8.2",
87
"guzzlehttp/guzzle": "^7.9",

0 commit comments

Comments
 (0)