-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add github workflow release + php (replace test) (#4)
* feat: github workflow release + php * fix: php_versions 7.4 only * feat: add license, scrutinizer conf + update README.md * chore fix: README.md * fix: tune scrutinizer conf * chore fix: php version 7.4 scrutinizer * fix: tuning scrutinizer * fix: tuning scrutinizer * fix: tuning scrutinizer * fix: license LGPL
- Loading branch information
Showing
7 changed files
with
296 additions
and
212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: 'php' | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- '**/*.php' | ||
- '.github/workflows/php.yml' | ||
- 'composer.json' | ||
push: | ||
paths: | ||
- '**/*.php' | ||
- '.github/workflows/php.yml' | ||
- 'composer.json' | ||
|
||
jobs: | ||
cs: | ||
uses: bedita/github-workflows/.github/workflows/php-cs.yml@v1 | ||
with: | ||
php_versions: '["7.4"]' | ||
|
||
stan: | ||
uses: bedita/github-workflows/.github/workflows/php-stan.yml@v1 | ||
with: | ||
php_versions: '["7.4"]' | ||
|
||
unit: | ||
name: 'Run unit tests' | ||
if: "!contains(github.event.commits[0].message, '[skip ci]') && !contains(github.event.commits[0].message, '[ci skip]')" | ||
runs-on: 'ubuntu-latest' | ||
|
||
strategy: | ||
matrix: | ||
php-version: [7.4] | ||
|
||
steps: | ||
- name: 'Checkout current revision' | ||
uses: 'actions/checkout@v3' | ||
|
||
- name: 'Composer config GH token if available' | ||
run: 'if [ -n "$GH_TOKEN" ]; then composer config github-oauth.github.com ${GH_TOKEN}; fi' | ||
|
||
- name: 'Setup PHP' | ||
uses: 'shivammathur/setup-php@v2' | ||
with: | ||
php-version: '${{ matrix.php-version }}' | ||
tools: 'composer' | ||
extensions: 'mbstring, intl' | ||
|
||
- name: 'Discover Composer cache directory' | ||
id: 'cachedir' | ||
run: echo "path=$(composer global config cache-dir)" >> $GITHUB_OUTPUT | ||
|
||
- name: 'Share Composer cache across runs' | ||
uses: 'actions/cache@v3' | ||
with: | ||
path: '${{ steps.cachedir.outputs.path }}' | ||
key: "composer-${{ matrix.php-version }}-${{ hashFiles('**/composer.json') }}" | ||
restore-keys: | | ||
composer-${{ matrix.php-version }}- | ||
composer- | ||
- name: 'Install dependencies with Composer' | ||
run: 'composer install --prefer-dist --no-interaction' | ||
|
||
- name: 'Run PHPUnit with coverage' | ||
run: 'vendor/bin/phpunit --coverage-clover=clover.xml' | ||
|
||
- name: Check test coverage | ||
id: test-coverage | ||
uses: johanvanhelden/gha-clover-test-coverage-check@v1 | ||
with: | ||
percentage: '85' | ||
filename: 'clover.xml' | ||
|
||
- name: 'Export coverage results' | ||
uses: 'codecov/codecov-action@v3' | ||
with: | ||
files: './clover.xml' | ||
env_vars: PHP_VERSION | ||
|
||
- name: 'Archive code coverage results' | ||
uses: 'actions/upload-artifact@v3' | ||
with: | ||
name: 'PHP ${{ matrix.php }}' | ||
path: 'clover.xml' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Release | ||
|
||
on: | ||
pull_request_target: | ||
types: [closed] | ||
workflow_dispatch: | ||
inputs: | ||
releaseType: | ||
description: 'Release type' | ||
required: true | ||
default: 'patch' | ||
type: choice | ||
options: [patch, minor, major] | ||
|
||
jobs: | ||
release-job: | ||
uses: bedita/github-workflows/.github/workflows/release.yml@v1 | ||
with: | ||
main_branch: 'main' | ||
dist_branches: '["main"]' | ||
version_bump: ${{ inputs.releaseType }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
checks: | ||
php: true | ||
filter: | ||
paths: | ||
- 'src/*' | ||
dependency_paths: | ||
- 'vendor/*' | ||
|
||
build: | ||
image: default-bionic | ||
nodes: | ||
analysis: | ||
environment: | ||
php: | ||
version: 7.4 | ||
pecl_extensions: | ||
- zip | ||
tests: | ||
override: | ||
- php-scrutinizer-run |
Oops, something went wrong.