Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: PHP tests

on:
pull_request:
branches: [ main ]

jobs:
build:

strategy:
matrix:
php: ['8.2', '8.3', '8.4']
symfony: ['6.4', '7.3']

runs-on: ubuntu-latest

name: On PHP ${{ matrix.php }} and Symfony ${{ matrix.symfony }}
steps:
# https://github.com/marketplace/actions/checkout
- name: Checkout
uses: actions/checkout@v5

# https://github.com/marketplace/actions/setup-php-action
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl
ini-values: post_max_size=256M, max_execution_time=180
tools: composer

- name: Check PHP version
run: php -v

- name: Validate composer.json and composer.lock
run: composer validate

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Install Symfony ${{ matrix.symfony }} packages
run: |
composer update symfony/console:${{ matrix.symfony }}
composer update symfony/stopwatch:${{ matrix.symfony }}

- name: Code lint PHP files
run: ./vendor/bin/phplint

- name: Coding standards
run: ./vendor/bin/phpcs

- name: PHPUnit
run: ./vendor/bin/phpunit
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
vendor
.phpunit.result.cache
package-lock.json
tests/example/apollo
composer.lock
var/cache/*
var/cache/*
.phpunit.cache
.phpunit.result.cache
.phplint.cache
31 changes: 31 additions & 0 deletions .phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0"?>

<!-- see https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-Ruleset -->
<ruleset name="Studio 24">

<!-- One or more files and/or directories to check -->
<file>src</file>
<file>tests</file>

<!-- Ignore files that match this pattern -->
<!-- <exclude-pattern>path/to/*</exclude-pattern> -->

<!-- Command line options -->
<!-- see https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage -->
<arg name="extensions" value="php" />
<arg name="basepath" value="."/>
<arg name="colors"/>
<arg name="parallel" value="75"/>
<arg value="np"/>

<!-- Coding standards rules to test for -->
<rule ref="PSR12" />

<!-- Namespaces and classes MUST follow PSR-0.
This means each class is in a file by itself, and is in a namespace of at least one level: a top-level vendor name. -->
<!-- Exclude tests from this rule -->
<rule ref="PSR1.Classes.ClassDeclaration">
<exclude-pattern>tests/*</exclude-pattern>
</rule>

</ruleset>
6 changes: 6 additions & 0 deletions .phplint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
path: ./
jobs: 10
extensions:
- php
exclude:
- vendor
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Key features:

## Requirements

* PHP 7.4+
* PHP 8.2+
* [Composer](https://getcomposer.org/)

## Installation
Expand Down Expand Up @@ -61,4 +61,4 @@ See [contributing](docs/contributing.md) for making changes to this repo.

Developed by [Simon R Jones](https://github.com/simonrjones/), HTML/CSS design system layout by Nicola Saunders.

Inspired by [GOVUK Design System](https://design-system.service.gov.uk/) and [Drizzle](https://github.com/cloudfour/drizzle).
Inspired by [GOVUK Design System](https://design-system.service.gov.uk/) and [Drizzle](https://github.com/cloudfour/drizzle).
Loading