-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28: add testing in CI; update readme; fix psalm i…
…ssues
- Loading branch information
Showing
39 changed files
with
994 additions
and
120 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,65 @@ | ||
name: Psalm | ||
|
||
on: | ||
pull_request: | ||
paths-ignore: | ||
- 'docs/**' | ||
- 'bin/**' | ||
- 'resources/**' | ||
- 'README.md' | ||
- 'CHANGELOG.md' | ||
- '.gitignore' | ||
- '.gitattributes' | ||
- '.editorconfig' | ||
- 'psalm.xml' | ||
|
||
push: | ||
paths-ignore: | ||
- 'docs/**' | ||
- 'bin/**' | ||
- 'resources/**' | ||
- 'README.md' | ||
- 'CHANGELOG.md' | ||
- '.gitignore' | ||
- '.gitattributes' | ||
- '.editorconfig' | ||
- 'psalm.xml' | ||
|
||
jobs: | ||
psalm: | ||
name: Psalm Validation (PHP ${{ matrix.php }}, OS ${{ matrix.os }}) | ||
runs-on: ${{ matrix.os }} | ||
continue-on-error: true | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: [8.2] | ||
os: [ubuntu-latest] | ||
steps: | ||
- name: Set up PHP ${{ matrix.php }} | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: dom | ||
|
||
- name: Check Out Code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Get Composer Cache Directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: Cache Dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: php-${{ matrix.php }}-${{ runner.os }}-composer- | ||
|
||
- name: Install Composer Dependencies | ||
run: composer install --prefer-dist --no-interaction | ||
|
||
- name: Run Tests | ||
run: vendor/bin/psalm |
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,112 @@ | ||
name: Unit | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
test-suite: | ||
required: true | ||
type: string | ||
fail-fast: | ||
required: false | ||
type: boolean | ||
default: true | ||
test-timeout: | ||
required: false | ||
type: number | ||
default: 15 | ||
|
||
pull_request: | ||
paths-ignore: | ||
- 'docs/**' | ||
- 'bin/**' | ||
- 'resources/**' | ||
- 'README.md' | ||
- 'CHANGELOG.md' | ||
- '.gitignore' | ||
- '.gitattributes' | ||
- '.editorconfig' | ||
- 'psalm.xml' | ||
|
||
push: | ||
paths-ignore: | ||
- 'docs/**' | ||
- 'bin/**' | ||
- 'resources/**' | ||
- 'README.md' | ||
- 'CHANGELOG.md' | ||
- '.gitignore' | ||
- '.gitattributes' | ||
- '.editorconfig' | ||
- 'psalm.xml' | ||
|
||
jobs: | ||
test: | ||
name: (PHP ${{ matrix.php }}, ${{ matrix.os }}, ${{ matrix.dependencies }} deps | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: ${{ matrix.timeout-minutes }} | ||
env: { GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' } | ||
strategy: | ||
fail-fast: ${{ inputs.fail-fast }} | ||
matrix: | ||
php: [ 8.1, 8.2 ] | ||
os: [ ubuntu-latest, windows-latest ] | ||
dependencies: [ lowest , highest ] | ||
timeout-minutes: [ '${{ inputs.test-timeout }}' ] | ||
exclude: | ||
- os: windows-latest | ||
php: 8.2 | ||
include: | ||
- os: ubuntu-latest | ||
php: 8.3 | ||
dependencies: highest | ||
timeout-minutes: 40 | ||
steps: | ||
- name: Set Git To Use LF | ||
run: | | ||
git config --global core.autocrlf false | ||
git config --global core.eol lf | ||
- name: Setup PHP ${{ matrix.php }} | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
tools: composer:v2 | ||
extensions: sockets, curl | ||
|
||
- name: Check Out Code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate --strict | ||
|
||
- 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@v3 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: php-${{ matrix.php }}-${{ matrix.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
php-${{ matrix.php }}-${{ matrix.os }}-composer- | ||
- name: Install lowest dependencies from composer.json | ||
if: matrix.dependencies == 'lowest' | ||
run: composer update --no-interaction --no-progress --prefer-lowest | ||
|
||
- name: Validate lowest dependencies | ||
if: matrix.dependencies == 'lowest' | ||
env: | ||
COMPOSER_POOL_OPTIMIZER: 0 | ||
run: vendor/bin/validate-prefer-lowest | ||
|
||
- name: Install highest dependencies from composer.json | ||
if: matrix.dependencies == 'highest' | ||
run: composer update --no-interaction --no-progress | ||
|
||
- name: Run tests | ||
run: vendor/bin/phpunit --testsuite=${{ inputs.test-suite }} --testdox |
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,65 @@ | ||
name: Security | ||
|
||
on: | ||
pull_request: | ||
paths-ignore: | ||
- 'docs/**' | ||
- 'bin/**' | ||
- 'resources/**' | ||
- 'README.md' | ||
- 'CHANGELOG.md' | ||
- '.gitignore' | ||
- '.gitattributes' | ||
- '.editorconfig' | ||
- 'psalm.xml' | ||
|
||
push: | ||
paths-ignore: | ||
- 'docs/**' | ||
- 'bin/**' | ||
- 'resources/**' | ||
- 'README.md' | ||
- 'CHANGELOG.md' | ||
- '.gitignore' | ||
- '.gitattributes' | ||
- '.editorconfig' | ||
- 'psalm.xml' | ||
|
||
jobs: | ||
security: | ||
name: Security Checks (PHP ${{ matrix.php }}, OS ${{ matrix.os }}) | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# Note: This workflow requires only the LATEST version of PHP | ||
php: [ 8.2 ] | ||
os: [ ubuntu-latest ] | ||
steps: | ||
- name: Set up PHP ${{ matrix.php }} | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: dom, sockets, grpc, curl | ||
|
||
- name: Check Out Code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Get Composer Cache Directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: Cache Dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: php-${{ matrix.php }}-${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: php-${{ matrix.php }}-${{ runner.os }}-composer- | ||
|
||
- name: Install Composer Dependencies | ||
run: composer install --prefer-dist --no-interaction | ||
|
||
- name: Verify | ||
run: composer require --dev roave/security-advisories:dev-latest |
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,11 @@ | ||
name: Testing | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
unit: | ||
name: Unit Testing | ||
uses: ./.github/workflows/run-test-suite.yml | ||
with: | ||
fail-fast: false | ||
test-suite: Unit |
Oops, something went wrong.