Skip to content

Commit

Permalink
Clean up CI config, use best practices
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowhand committed Oct 16, 2024
1 parent 28e5e22 commit 31684de
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 60 deletions.
116 changes: 58 additions & 58 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,89 +1,89 @@
# https://docs.github.com/en/actions

name: "CI"
name: CI

on:
pull_request: ~
push:
branches:
- "master"
- master

env:
COMPOSER_ROOT_VERSION: 1.99

jobs:
coding-standards:
name: "Coding Standards"
name: Coding Standards

runs-on: "ubuntu-latest"
runs-on: ubuntu-latest

steps:
- name: "Checkout"
uses: "actions/checkout@v3"
- name: Checkout
uses: actions/checkout@v3

- name: "Install PHP"
uses: "shivammathur/[email protected]"
- name: Install PHP
uses: shivammathur/[email protected]
with:
coverage: "none"
extensions: "mbstring"
php-version: "7.4"
tools: "composer-normalize"
php-version: '8.3'
extensions: mbstring
tools: composer-normalize, php-cs-fixer

- name: "Validate composer.json"
run: "composer validate --strict"
- name: Validate composer.json
run: >-
composer validate --strict
- name: "Normalize composer.json"
run: "composer-normalize --dry-run"
- name: Normalize composer.json
run: >-
composer-normalize --dry-run
- name: "PHP-CS-Fixer"
uses: "docker://oskarstark/php-cs-fixer-ga:2.18.0"
with:
args: "--dry-run --diff-format udiff"
- name: PHP code style check
run: >-
php-cs-fixer check
static-code-analysis:
name: "Static Code Analysis"
name: Static Code Analysis

runs-on: "ubuntu-latest"
runs-on: ubuntu-latest

steps:
- name: "Checkout"
uses: "actions/checkout@v3"
- name: Checkout
uses: actions/checkout@v3

- name: "Install PHP"
uses: "shivammathur/[email protected]"
- name: Install PHP
uses: shivammathur/[email protected]
with:
coverage: "none"
extensions: "mbstring"
coverage: none
extensions: mbstring
php-version: "7.4"

- name: "Install dependencies with composer"
- name: Install dependencies with composer
run: "composer update --no-interaction --no-progress && composer i --working-dir=ci"

- name: "Run vimeo/psalm"
- name: Run vimeo/psalm
run: "ci/vendor/bin/psalm --threads=4"

roave-bc-check:
name: "Roave BC Check"
name: Roave BC Check

runs-on: "ubuntu-latest"
runs-on: ubuntu-latest

steps:
- name: "Checkout code"
uses: "actions/checkout@v3"
- name: Checkout code
uses: actions/checkout@v3

- name: "Install PHP"
uses: "shivammathur/[email protected]"
- name: Install PHP
uses: shivammathur/[email protected]

- name: "Install Roave BC check"
- name: Install Roave BC check
run: "composer require --dev roave/backward-compatibility-check"

- name: "Run Roave BC check"
- name: Run Roave BC check
run: "vendor/bin/roave-backward-compatibility-check"

tests:
name: "Tests"
name: Tests

runs-on: "ubuntu-latest"
runs-on: ubuntu-latest

strategy:
matrix:
Expand All @@ -96,45 +96,45 @@ jobs:
- "8.2"

steps:
- name: "Checkout"
uses: "actions/checkout@v3"
- name: Checkout
uses: actions/checkout@v3

- name: "Install PHP"
uses: "shivammathur/[email protected]"
- name: Install PHP
uses: shivammathur/[email protected]
with:
coverage: "none"
extensions: "mbstring"
coverage: none
extensions: mbstring
php-version: "${{ matrix.php-version }}"

- name: "Install dependencies with composer"
- name: Install dependencies with composer
run: "composer update --no-interaction --no-progress"

- name: "Run unit tests"
- name: Run unit tests
run: "vendor/bin/phpunit"

windows-tests:
name: "Windows tests"
name: Windows tests

runs-on: "windows-latest"
runs-on: windows-latest

strategy:
matrix:
php-version:
- "7.4"

steps:
- name: "Checkout"
uses: "actions/checkout@v3"
- name: Checkout
uses: actions/checkout@v3

- name: "Install PHP"
uses: "shivammathur/[email protected]"
- name: Install PHP
uses: shivammathur/[email protected]
with:
coverage: "none"
extensions: "mbstring"
coverage: none
extensions: mbstring
php-version: "${{ matrix.php-version }}"

- name: "Install dependencies with composer"
- name: Install dependencies with composer
run: "composer update --no-interaction --no-progress"

- name: "Run unit tests"
- name: Run unit tests
run: "vendor/bin/phpunit tests/AssertTest.php"
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
vendor/
/composer.lock
.php-cs-fixer.cache
.phpunit.result.cache
.php_cs.cache
2 changes: 1 addition & 1 deletion .php_cs → .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
->in(__DIR__.'/tests')
;

return PhpCsFixer\Config::create()
return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setRules([
'@PSR2' => true,
Expand Down

0 comments on commit 31684de

Please sign in to comment.