forked from thompsonsj/LibRIS
-
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.
* Added phpunit tests, removed old build process * Set up with shivammathur/setup-php, configured phan * Run php-cs-fixer @PHP70Migration, @PHP71Migration, @PHP73Migration * Removed composer.lock from repo * Added PHP 7.3, 7.4, 8.0 into a build matrix
- Loading branch information
Showing
20 changed files
with
2,744 additions
and
834 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,42 @@ | ||
name: ci | ||
|
||
on: [ push, pull_request ] | ||
|
||
jobs: | ||
build-test: | ||
name: Test on PHP ${{ matrix.php-versions }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php-versions: [ '7.3', '7.4', '8.0' ] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP, with composer and extensions | ||
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php | ||
with: | ||
php-version: ${{ matrix.php-versions }} | ||
extensions: ast | ||
coverage: none | ||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: Cache composer dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
|
||
- name: Install Composer dependencies | ||
run: composer install --no-progress --prefer-dist --optimize-autoloader | ||
|
||
- name: Test with phpunit | ||
run: vendor/bin/phpunit | ||
|
||
- name: Test with phan | ||
run: vendor/bin/phan |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
bin/build/ | ||
vendor | ||
composer.lock |
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,76 @@ | ||
<?php | ||
|
||
/** | ||
* This configuration will be read and overlaid on top of the | ||
* default configuration. Command line arguments will be applied | ||
* after this file is read. | ||
*/ | ||
return [ | ||
|
||
// Supported values: `'5.6'`, `'7.0'`, `'7.1'`, `'7.2'`, `'7.3'`, `'7.4'`, | ||
// `'8.0'`, `'8.1'`, `null`. | ||
// If this is set to `null`, | ||
// then Phan assumes the PHP version which is closest to the minor version | ||
// of the php executable used to execute Phan. | ||
'target_php_version' => '7.4', | ||
|
||
'minimum_target_php_version' => '7.3', | ||
|
||
'backward_compatibility_checks' => true, | ||
|
||
// A list of directories that should be parsed for class and | ||
// method information. After excluding the directories | ||
// defined in exclude_analysis_directory_list, the remaining | ||
// files will be statically analyzed for errors. | ||
// | ||
// Thus, both first-party and third-party code being used by | ||
// your application should be included in this list. | ||
'directory_list' => [ | ||
'src', | ||
'tests', | ||
'vendor/phpunit/phpunit/src', | ||
], | ||
|
||
// A directory list that defines files that will be excluded | ||
// from static analysis, but whose class and method | ||
// information should be included. | ||
// | ||
// Generally, you'll want to include the directories for | ||
// third-party code (such as "vendor/") in this list. | ||
// | ||
// n.b.: If you'd like to parse but not analyze 3rd | ||
// party code, directories containing that code | ||
// should be added to the `directory_list` as | ||
// to `exclude_analysis_directory_list`. | ||
"exclude_analysis_directory_list" => [ | ||
'vendor/', | ||
], | ||
|
||
// A list of plugin files to execute. | ||
// Plugins which are bundled with Phan can be added here by providing their name | ||
// (e.g. 'AlwaysReturnPlugin') | ||
// | ||
// Documentation about available bundled plugins can be found | ||
// at https://github.com/phan/phan/tree/v5/.phan/plugins | ||
// | ||
// Alternately, you can pass in the full path to a PHP file | ||
// with the plugin's implementation. | ||
// (e.g. 'vendor/phan/phan/.phan/plugins/AlwaysReturnPlugin.php') | ||
'plugins' => [ | ||
// checks if a function, closure or method unconditionally returns. | ||
// can also be written as 'vendor/phan/phan/.phan/plugins/AlwaysReturnPlugin.php' | ||
'AlwaysReturnPlugin', | ||
'DollarDollarPlugin', | ||
'DuplicateArrayKeyPlugin', | ||
'DuplicateExpressionPlugin', | ||
'PregRegexCheckerPlugin', | ||
'PrintfCheckerPlugin', | ||
'SleepCheckerPlugin', | ||
// Checks for syntactically unreachable statements in | ||
// the global scope or function bodies. | ||
'UnreachableCodePlugin', | ||
'UseReturnValuePlugin', | ||
'EmptyStatementListPlugin', | ||
'LoopVariableReusePlugin', | ||
], | ||
]; |
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
Oops, something went wrong.