-
-
Notifications
You must be signed in to change notification settings - Fork 30
feat: add automation, linting and improve DX #174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Draft
Changes from all commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
2258e90
fix: .editorconfig
lotyp c8c6e57
feat: add .env file for local development and testing
lotyp 35218e4
fix: production release should not contain development files
lotyp e963a39
feat: add pre-commit config file
lotyp fa62923
feat: add self-documenting Makefile and docker-compose for local dev ...
lotyp cedd95e
docs: mention make commands in CONTRIBUTING.md
lotyp c3bdc70
feat!: bump minimal php version from 8.0 to 8.1
lotyp 43b6b87
feat: add wayofdev/php-cs-fixer and roave/security-advisories
lotyp 6e6a07c
feat: remove style-ci dependency
lotyp 1a01cfb
chore: move CODE_OF_CONDUCT
lotyp 397b07a
feat: add yamllint
lotyp 8a7014f
chore: return back .styleci, as it bloats commits
lotyp 2cbbff8
feat: add googleapis/release-please auto changelog generator configs
lotyp d8ae4ac
chore(feat/infra-dx-v2): release 3.0.0
lotyp 9856508
docs: convert CHANGELOG.md to follow release-please format
lotyp ef9f758
feat: introduce .build directory to move various tool cache into one ...
lotyp c4a6d3f
ci: add release-please github action
lotyp b7b65c5
ci: refactoring github actions
lotyp 17aac80
style: lint composer.json using `composer normalize` command
lotyp d686f42
ci: fix target branch for new CI actions
lotyp 66a618b
ci: run coverage against sqlite
lotyp 5ff4a40
chore: trigger actions to check if composer cache works
lotyp 99ca6a5
ci: add coding-standards job
lotyp ef18b28
ci: add static-analysis job
lotyp 014fe00
ci: fix concurrency, set psalm format to github output
lotyp d4f889b
deps(composer): add psalm/plugin-phpunit dependency
lotyp 3a70d7c
ci: add mutation-testing job
lotyp 831fb04
ci: add action to test against pgsql
lotyp fa3c4d0
ci: fix version for php setup action
lotyp 522cdca
fix: typo in gh-actions
lotyp 7b555e8
ci: add postgres service as depdendency
lotyp edc3eb8
ci: run only postgres tests against pgsql integration
lotyp 8ba7bcc
feat: add initial psalm baseline file
lotyp d421d64
ci: fix infection tests
lotyp 93d2036
ci: fix mutation tests github action
lotyp ea07603
ci: add mysql integration action
lotyp 822ca9b
chore: switch to latesst tag in mysql
lotyp 1cf29cc
ci: fix mysql integration action
lotyp a428d00
ci: add sqlserver (mssql) action
lotyp 2387dbb
ci: add pdo dependencies to php, increase sqlserver health-checks
lotyp 7b5da77
ci: remove health-checks for sqlserver
lotyp d1c96e1
ci: fix password for SA account of mssql
lotyp 6ec430e
feat: add security and dependency analysis
lotyp a5ad866
ci: coding standards improvements
lotyp 1355dda
chore: remove unused classes
lotyp cdeceaa
fix: psalm errors
lotyp 2d6b5b0
feat: make commit runs through docker now
lotyp bbeb2f2
chore: same pass for all dbs
lotyp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,2 @@ | ||
| * | ||
| !.gitignore |
This file contains hidden or 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
This file contains hidden or 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 @@ | ||
| # https://docs.docker.com/compose/reference/envvars/#compose_project_name | ||
| # With custom namespace provided, it will be used to prefix all services | ||
| # in Docker network for current project | ||
| COMPOSE_PROJECT_NAME=cycle-database | ||
| APP_ENV=production | ||
|
|
||
| DB_CONNECTION=pgsql | ||
| DB_HOST=pgsql | ||
| DB_PORT=5432 | ||
|
|
||
| DB_DATABASE=default | ||
| DB_USERNAME=root | ||
| DB_PASSWORD=Strong(!)Password | ||
|
|
||
| DB_SQLSERVER_FORWARD_PORT=11433 | ||
| DB_MYSQL_FORWARD_PORT=13306 | ||
| DB_PGSQL_FORWARD_PORT=15432 | ||
|
|
||
| XDEBUG_MODE=coverage | ||
|
|
||
| GITHUB_TOKEN=ghp_ |
This file contains hidden or 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,5 +1,21 @@ | ||
| /.github export-ignore | ||
| /.editorconfig export-ignore | ||
| /.gitattributes export-ignore | ||
| /.gitignore export-ignore | ||
| /tests export-ignore | ||
| /.build export-ignore | ||
| /.github export-ignore | ||
| /.phive/ export-ignore | ||
| /tests export-ignore | ||
| .editorconfig export-ignore | ||
| .env.example export-ignore | ||
| .gitattributes export-ignore | ||
| .gitignore export-ignore | ||
| .php-cs-fixer.dist.php export-ignore | ||
| .pre-commit-config.yaml export-ignore | ||
| .scrutinizer.yml export-ignore | ||
| .styleci.yml export-ignore | ||
| .yamllint.yaml export-ignore | ||
| composer.lock export-ignore | ||
| composer-require-checker.json export-ignore | ||
| docker-compose.yaml export-ignore | ||
| infection.json.dist export-ignore | ||
| Makefile export-ignore | ||
| phpunit.xml export-ignore | ||
| psalm.xml export-ignore | ||
| psalm-baseline.xml export-ignore |
This file contains hidden or 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,72 @@ | ||
| { | ||
| "release-type": "node", | ||
| "packages": { | ||
| ".": { | ||
| "package-name": "database", | ||
| "changelog-path": "/CHANGELOG.md" | ||
| } | ||
| }, | ||
| "include-component-in-tag": false, | ||
| "changelog-sections": [ | ||
| { | ||
| "type": "feat", | ||
| "section": "Features", | ||
| "hidden": false | ||
| }, | ||
| { | ||
| "type": "fix", | ||
| "section": "Bug Fixes", | ||
| "hidden": false | ||
| }, | ||
| { | ||
| "type": "perf", | ||
| "section": "Performance Improvements", | ||
| "hidden": false | ||
| }, | ||
| { | ||
| "type": "docs", | ||
| "section": "Documentation", | ||
| "hidden": false | ||
| }, | ||
| { | ||
| "type": "chore", | ||
| "section": "Miscellaneous", | ||
| "hidden": false | ||
| }, | ||
| { | ||
| "type": "style", | ||
| "section": "Styles", | ||
| "hidden": true | ||
| }, | ||
| { | ||
| "type": "revert", | ||
| "section": "Reverts", | ||
| "hidden": true | ||
| }, | ||
| { | ||
| "type": "deps", | ||
| "section": "Dependencies", | ||
| "hidden": false | ||
| }, | ||
| { | ||
| "type": "refactor", | ||
| "section": "Code Refactoring", | ||
| "hidden": false | ||
| }, | ||
| { | ||
| "type": "test", | ||
| "section": "Tests", | ||
| "hidden": true | ||
| }, | ||
| { | ||
| "type": "build", | ||
| "section": "Build System", | ||
| "hidden": true | ||
| }, | ||
| { | ||
| "type": "ci", | ||
| "section": "Continuous Integration", | ||
| "hidden": true | ||
| } | ||
| ] | ||
| } |
This file contains hidden or 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,3 @@ | ||
| { | ||
| ".": "3.0.0" | ||
| } |
File renamed without changes.
This file contains hidden or 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,14 @@ | ||
| --- | ||
|
|
||
| # this file is for the labeler workflow job | ||
| # Documentation https://github.com/marketplace/actions/labeler | ||
|
|
||
| "type: documentation": | ||
| - changed-files: | ||
| - any-glob-to-any-file: [resources/*, .github/*, ./*.md] | ||
|
|
||
| "type: maintenance": | ||
| - changed-files: | ||
| - any-glob-to-any-file: [tests/**/*, .github/workflows/*] | ||
|
|
||
| ... |
This file contains hidden or 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,23 @@ | ||
| --- | ||
|
|
||
| # This workflow will triage pull requests and apply a label based on the | ||
| # paths that are modified in the pull request. | ||
| # | ||
| # To use this workflow, you will need to set up a .github/labeler.yml | ||
| # file with configuration. For more information, see: | ||
| # https://github.com/actions/labeler/blob/master/README.md | ||
|
|
||
| on: # yamllint disable-line rule:truthy | ||
| pull_request: | ||
|
|
||
| name: 🏷️ Add labels | ||
|
|
||
| jobs: | ||
| label: | ||
| uses: wayofdev/gh-actions/.github/workflows/apply-labels.yml@master | ||
| with: | ||
| os: ubuntu-latest | ||
| secrets: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| ... |
This file contains hidden or 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,88 +1,78 @@ | ||
| on: | ||
| push: | ||
| --- | ||
|
|
||
| on: # yamllint disable-line rule:truthy | ||
| pull_request: | ||
| branches: | ||
| - master | ||
| - '*.*' | ||
| - '*.*.*' | ||
| pull_request: null | ||
| - 2.x | ||
|
|
||
| name: ci-mssql | ||
| name: 🔍 Integration with SQLServer | ||
|
|
||
| jobs: | ||
| tests: | ||
| name: PHP ${{ matrix.php }}-mssql-${{ matrix.mssql }} | ||
|
|
||
| env: | ||
| key: cache | ||
|
|
||
| runs-on: ubuntu-latest | ||
|
|
||
| test-mssql: | ||
| timeout-minutes: 4 | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| fail-fast: true | ||
| matrix: | ||
| include: | ||
| - php: '8.0' | ||
| extensions: pdo, pdo_sqlsrv | ||
| mssql: 'server:2017-latest' | ||
| - php: '8.0' | ||
| extensions: pdo, pdo_sqlsrv | ||
| mssql: 'server:2019-latest' | ||
| - php: '8.1' | ||
| extensions: pdo, pdo_sqlsrv | ||
| mssql: 'server:2019-latest' | ||
| - php: '8.2' | ||
| extensions: pdo, pdo_sqlsrv | ||
| mssql: 'server:2019-latest' | ||
| - php: '8.3' | ||
| extensions: pdo, pdo_sqlsrv | ||
| mssql: 'server:2019-latest' | ||
| os: | ||
| - 'ubuntu-latest' | ||
| php-version: | ||
| - '8.2' | ||
| dependencies: | ||
| - locked | ||
| mssql-version: | ||
| - latest | ||
|
|
||
| services: | ||
| mssql: | ||
| image: mcr.microsoft.com/mssql/${{ matrix.mssql }} | ||
| env: | ||
| SA_PASSWORD: SSpaSS__1 | ||
| ACCEPT_EULA: Y | ||
| MSSQL_PID: Developer | ||
| ports: | ||
| - 11433:1433 | ||
| options: --name=mssql --health-cmd="/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'SSpaSS__1' -Q 'SELECT 1'" --health-interval=10s --health-timeout=5s --health-retries=3 | ||
| image: mcr.microsoft.com/mssql/server:2019-latest | ||
| env: | ||
| ACCEPT_EULA: 'Y' | ||
| SA_PASSWORD: 'SSpaSS__1' | ||
| ports: | ||
| - 11433:1433 | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v2 | ||
| - name: 📦 Check out the codebase | ||
| uses: actions/checkout@v4.1.1 | ||
|
|
||
| - name: Install PHP with extensions | ||
| uses: shivammathur/setup-php@v2 | ||
| - name: 🛠️ Setup PHP | ||
| uses: shivammathur/setup-php@2.30.1 | ||
| with: | ||
| php-version: ${{ matrix.php }} | ||
| extensions: ${{ matrix.extensions }} | ||
| ini-values: date.timezone='UTC' | ||
| tools: composer:v2, pecl | ||
| php-version: ${{ matrix.php-version }} | ||
| extensions: mbstring, pdo, pdo_sqlite, pdo_sqlsrv, json | ||
| ini-values: error_reporting=E_ALL | ||
| coverage: none | ||
|
|
||
| - name: Determine composer cache directory on Linux | ||
| run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV | ||
| - name: 🛠️ Setup problem matchers | ||
| run: | | ||
| echo "::add-matcher::${{ runner.tool_cache }}/php.json" | ||
| echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | ||
|
|
||
| - name: Cache dependencies installed with composer | ||
| uses: actions/cache@v2 | ||
| - name: 🤖 Validate composer.json and composer.lock | ||
| run: composer validate --ansi --strict | ||
|
|
||
| - name: 🔍 Get composer cache directory | ||
| uses: wayofdev/gh-actions/actions/composer/get-cache-directory@master | ||
|
|
||
| - name: ♻️ Restore cached dependencies installed with composer | ||
| uses: actions/cache@v4.0.2 | ||
| with: | ||
| path: ${{ env.COMPOSER_CACHE_DIR }} | ||
| key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }} | ||
| restore-keys: | | ||
| php${{ matrix.php }}-composer- | ||
| key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }} | ||
| restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}- | ||
|
|
||
| - name: Update composer | ||
| run: composer self-update | ||
| - name: 🗑️ Remove PHP platform configuration | ||
| if: "matrix.dependencies != 'locked'" | ||
| run: composer config platform.php --ansi --unset | ||
|
|
||
| - name: Install dependencies with composer | ||
| if: matrix.php != '8.3' | ||
| run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi | ||
| - name: 📥 Install "${{ matrix.dependencies }}" dependencies | ||
| uses: wayofdev/gh-actions/actions/composer/install@master | ||
| with: | ||
| dependencies: ${{ matrix.dependencies }} | ||
|
|
||
| - name: Install dependencies with composer php 8.3 | ||
| if: matrix.php == '8.3' | ||
| run: composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi | ||
| - name: 🧪 Run unit tests with phpunit | ||
| run: php vendor/bin/phpunit --colors=always --testsuite=Unit | ||
|
|
||
| - name: Run tests with phpunit without coverage | ||
| env: | ||
| DB: sqlserver | ||
| run: vendor/bin/phpunit --group driver-sqlserver --colors=always | ||
| - name: 🧪 Run integration tests with phpunit | ||
| run: php vendor/bin/phpunit --colors=always --testsuite=DBAL --group driver-sqlserver |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.