Skip to content

Commit

Permalink
feature/build and version cleanup (#84)
Browse files Browse the repository at this point in the history
* github workflow update
* move to different phpunit runner
* remove lock file, open dependencies
* ignore lock file, update actions
* move to build matrix
  • Loading branch information
maschmann authored Feb 28, 2023
1 parent 6545925 commit 028a756
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 2,360 deletions.
55 changes: 0 additions & 55 deletions .github/workflows/static-analysis-8-1.yml

This file was deleted.

45 changes: 24 additions & 21 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Test and analyze PHP 8.0
name: Test and analyze PHP
on:
push: {}
pull_request:
Expand All @@ -9,37 +9,40 @@ on:
jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
php:
- "8.0"
- "8.1"
- "8.2"
include:
- php-version: "8.0"
phpunit: "9.5"
phpunit-config: "phpunit.xml.dist"

steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
php-version: "${{ matrix.php }}"
extensions: redis, apcu, ctype, dom, iconv, gd, mbstring, fileinfo, intl, json, mysql, bcmath, zip
coverage: none # disable xdebug, pcov
ini-values: post_max_size=256M memory
tools: cs2pr, pecl, php-cs-fixer, phpunit, vimeo/psalm, phpstan, phpcs

- uses: actions/checkout@v2
tools: cs2pr, pecl, php-cs-fixer, vimeo/psalm, phpstan, phpcs

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/checkout@v3

- name: Cache dependencies
uses: actions/cache@v2
- uses: "ramsey/composer-install@v2"
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
composer-options: "--no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist -q"

- name: Install dependencies
run: composer install --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist -q

- name: Install phpunit output for PRs
run: composer require mheap/phpunit-github-actions-printer

- name: Run UnitTests
run: phpunit --printer mheap\\GithubActionsReporter\\Printer -c phpunit.xml.dist
- name: PHPUnit tests
uses: php-actions/phpunit@v3
with:
version: "${{ matrix.phpunit }}"
configuration: "${{ matrix.phpunit-config }}"
memory_limit: "256M"

- name: Run phpstan
run: phpstan analyse --error-format=checkstyle -c "phpstan.neon" | cs2pr
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ Tests/data/**
!Tests/data/cache/.empty
!Tests/data/logs/.empty
!Tests/data/temp/.empty
composer.lock
.phpunit.cache
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# php-ansible library
![PHP8.0 build](https://github.com/maschmann/php-ansible/actions/workflows/static-analysis.yml/badge.svg)
![PHP8.1 build](https://github.com/maschmann/php-ansible/actions/workflows/static-analysis-8-1.yml/badge.svg)
![Build PHP 8.0/8.1/8.2](https://github.com/maschmann/php-ansible/actions/workflows/static-analysis.yml/badge.svg)

This library is a OOP-wrapper for the ansible provisioning tool.
I intend to use this library for a symfony2 bundle and also a deployment GUI, based on php/symfony2.
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
}
],
"require": {
"php": "^8.0.0",
"php": "^8.0.0|^8.1.0|^8.2.0",
"psr/log": "^1.1",
"symfony/process": "^5.3|^6.0"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"phpunit/phpunit": "^9.5|^10.0 ",
"mikey179/vfsstream": "^1.6"
},
"autoload": {
Expand Down
Loading

0 comments on commit 028a756

Please sign in to comment.